Jump to content
UBot Underground

scraping more than one page save results to one text file


Recommended Posts

Im triing to scrape say 3 pages. I able to scrape the first page  have ubot nav to the second page ,but thi sis were I run into issues. I cant get it to scrape the second page an save in the same text file as the first page. Do I need to make seperate save files for each  page I will have it navigate and scrape?  Any ideas will help -thanks.

Link to post
Share on other sites

Hi roguehat.

 

Once you have gone through the three pages (looping, manually etc) I would add all the scraped contents to one variable. Then at the end of the 3 pages write the variable to a text file.

 

For example

 

list variable mydata

 

page one -> scrape -> add_to_list -> mydata

page two-> scrape -> add_to_list -> mydata

page three-> scrape -> add_to_list -> mydata

 

variable save to file -> path -> sub mydata

Link to post
Share on other sites
  • 2 weeks later...

I am trying to do something similar. I scraped an url list and now I am looping through the list. I want to scrape some data on each url and save it to 1 file. Currently all I am saving is the data from the last visited url. How can I have ubot not overwrite but add to an existing list.

Link to post
Share on other sites

My solution to this issue was I scraped the data in the main loop that loops through the pages. I saved outside of the conditional "while" loop and then cleared list.

 

I modified the GooglePPC scraper that nevele wrote to illustrate the changes. You can download the source bot here. Its not as robust as the script nevele wrote but it gets the job done.

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...