Jump to content
UBot Underground

Scraping pages but can't get the last page


Recommended Posts

Hey all again. I scrape a yellowpages web site gathering addresses and phone numbers but the bit won't scrape the last page because I run the add list to list command inside of a loop while statement and the loop while looks for the next tag. When it gets to the last page it fails to scrape it. I somehow remember a trick was said about how it could be scraped but I can't find it

Link to post
Share on other sites

Maybe in the loop while set a second variable, say #lastPage = false for example.

 

Then when the page is scraped and the next button is not found you set that variable to true and the bot still continues that iteration.

 

On the next iteration your comparison statement will say that there is no next element and #lastPage = true therefore you can finally exit the loop while.

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