cob007 19 Posted September 20, 2018 Report Share Posted September 20, 2018 As u can see from the screenshot, I am scraping the following element FROM the "sponsored AD listings" in bing ads using xpath and xbrowser. Now the problem is not all "ADS' have this element,So exbrowser is adding it all to a list and does not return empty element, so in the final table it is a mismatch, the element 2 becomes element 1 etc And if i use exbrowser scrape elements feature then it scrapes all the elements but does not return any empty element if element is empty, so my list of scraping becomes wrong Is there a workaround for this issue, now ive heard to use if..exbrowser element exists statement, but then the element does exist in some "ADS' and in some it does not.How can I return an empty listing if element does not exist? Quote Link to post Share on other sites
HelloInsomnia 1103 Posted September 20, 2018 Report Share Posted September 20, 2018 I never scrape lists and then add them to tables for this reason. If there is a missing list item, or if a list item has multiple entries then the entire table gets corrupted with bad data. In these cases it's best scrape every part you need for each individual table entry - instead of trying to get all of the data at once using lists. So for example if you wanted to get all of the urls and descriptions, instead of grabbing one list of urls and one list of descriptions. I would go to the first result and get all of the urls and descriptions from the first result, enter them into the table or wherever, and then go to the second result and repeat. Now if the second result has 5 urls and 2 descriptions for some crazy reason then the data is still accurate. 2 Quote Link to post Share on other sites
cob007 19 Posted September 20, 2018 Author Report Share Posted September 20, 2018 ok thanks 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.