korneld 0 Posted September 12, 2012 Report Share Posted September 12, 2012 Hi. I built me a bot that scrapes the yellow pages. Everything is done and it works fine for the most part except for this: when a business doesn't have a phone number listed for instance, ubot just skips to the next one. Now my rows a different lenghts and the data is miss-matched. I'm using '$scrape attribute' to grab thing, then adding the results to a list which in turn get added to a column in a table. Is there a way to make ubot add a blank in such case? Quote Link to post Share on other sites
a2mateit 395 Posted September 12, 2012 Report Share Posted September 12, 2012 Try a comparison. If $nothing, then $new line Quote Link to post Share on other sites
blumi40 222 Posted September 12, 2012 Report Share Posted September 12, 2012 if($not($exists(<what="ever u looking for">))) { then { add item to list(%mylist, $new line, "Delete", "Global") }} not tested but should work Quote Link to post Share on other sites
mydearcosmo 1 Posted September 20, 2012 Report Share Posted September 20, 2012 I am working on my scraping bot and hope this works. http://imagicon.info/cat/5-34/smile2.png Quote Link to post Share on other sites
UBotBuddy 331 Posted September 20, 2012 Report Share Posted September 20, 2012 Find one business that has everything that you are looking for. Then. Start building in the logic and comparisons to test for their existence. Then the next time you encounter a business without that data you will know. For my own yellowbook scraper I always assume that it will not find that data so I load that variable with "N/A" or "Missing" and then if it finds it then that preloaded data will be changed to the found information. Also remember that if you are saving to a list then you need to account for those missing items so you will need to set your Advanced to "Not Delete" duplicates. Buddy Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.