Jump to content
UBot Underground

Write to csv


Recommended Posts

Hi guys,

 

I'm a little stuck. The bot I'm working is basically supposed to:

 

1) Load list of domains from a file into a list

2) Go to Yahoo!'s domain explorer and do a search

3) Scrape the backlinks (just on the first page of Yahoo's results)

4) Then write the domain that was checked along with the backlink URLs into the first row in a csv

 

The resulting file should look like this in principle:

 

Domain1,backlinkURL1,backlinkURL2,backlinkURL3,backlinkURL4, etc.

Domain2,backlinkURL1,backlinkURL2,backlinkURL3,backlinkURL4, etc.

Domain3,backlinkURL1,backlinkURL2,backlinkURL3,backlinkURL4, etc.

Domain4,backlinkURL1,backlinkURL2,backlinkURL3,backlinkURL4, etc.

etc.

 

How do I accomplish this?

 

I have attached what my bot looks like so far. Any help I can get is much appreciated.

 

Martin

Link to post
Share on other sites

Good question. When I think about it, I actually only need the first three backlink URLs. So the final file would look like:

 

Domain1,backlinkURL1,backlinkURL2,backlinkURL3

Domain2,backlinkURL1,backlinkURL2,backlinkURL3

Domain3,backlinkURL1,backlinkURL2,backlinkURL3

Domain4,backlinkURL1,backlinkURL2,backlinkURL3

etc.

 

Of course, it could fluctuate below 3 backlink URLs (0, 1, 2, or 3 backlinks). If no backlinks are present, there's no need to insert it into the list. That means in some places the file could look like:

 

...

DomainT,backlinkURL1,backlinkURL2,backlinkURL3

DomainL,backlinkURL1,backlinkURL2,backlinkURL3

DomainF,backlinkURL1,backlinkURL2,backlinkURL3

DomainP,backlinkURL1,backlinkURL2,backlinkURL3

DomainX,backlinkURL1

DomainY,backlinkURL1

DomainZ,backlinkURL1,backlinkURL2,backlinkURL3

DomainK,backlinkURL1,backlinkURL2

DomainE,backlinkURL1,backlinkURL2,backlinkURL3

DomainW,backlinkURL1,backlinkURL2,backlinkURL3

DomainQ,backlinkURL1,backlinkURL2,backlinkURL3

DomainS,backlinkURL1,backlinkURL2,backlinkURL3

etc.

 

- Martin

Link to post
Share on other sites

Good question. When I think about it, I actually only need the first three backlink URLs. So the final file would look like:

 

Domain1,backlinkURL1,backlinkURL2,backlinkURL3

Domain2,backlinkURL1,backlinkURL2,backlinkURL3

Domain3,backlinkURL1,backlinkURL2,backlinkURL3

Domain4,backlinkURL1,backlinkURL2,backlinkURL3

etc.

 

Of course, it could fluctuate below 3 backlink URLs (0, 1, 2, or 3 backlinks). If no backlinks are present, there's no need to insert it into the list. That means in some places the file could look like:

 

...

DomainT,backlinkURL1,backlinkURL2,backlinkURL3

DomainL,backlinkURL1,backlinkURL2,backlinkURL3

DomainF,backlinkURL1,backlinkURL2,backlinkURL3

DomainP,backlinkURL1,backlinkURL2,backlinkURL3

DomainX,backlinkURL1

DomainY,backlinkURL1

DomainZ,backlinkURL1,backlinkURL2,backlinkURL3

DomainK,backlinkURL1,backlinkURL2

DomainE,backlinkURL1,backlinkURL2,backlinkURL3

DomainW,backlinkURL1,backlinkURL2,backlinkURL3

DomainQ,backlinkURL1,backlinkURL2,backlinkURL3

DomainS,backlinkURL1,backlinkURL2,backlinkURL3

etc.

 

- Martin

 

So then you would need to set a variable called "rows" or whatever you'd prefer.

 

and you will put that variable in the table cell for the rows instead of numbers.

You would then need an inc command to increment that variable.

 

For the column cells, you will need to set then as 0, 1, 2, 3 (for four column cells each time, and it will be the same cell 0-3 each time)

 

You can use the if, then else command to decide what to do in case there is only 1 backlink url or if there are only 2 backlink urls.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...