Jump to content
UBot Underground

Dealing With Exbrowser Missing Element


Recommended Posts

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?

post-16700-0-97463800-1537447516_thumb.png

Link to post
Share on other sites

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.

  • Like 2
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...