Jump to content
UBot Underground

Help! List Or Variable Ignore Empty/missing Elements


Recommended Posts

Hi Friends,

 

can anyone help me to solved my issue...

 

I'm trying to scrape an element (<span>) which is inside the <DIV>, but since all DIV doesn't have <span> element. my data are getting messed up when im merging with other lists.

 

i guess variables and list ignore missing element values. i tried in scrape attribute, Xpath plugin and Delite CSS. nothing helping me

 

is there anyway to do this.  attaching my sample data..

 

please help!

post-32997-0-57181400-1524960019_thumb.jpg

Link to post
Share on other sites

you have 2 options: compare and verify number of scraped elements in the list and "fix" it if it is no what you expect or scrape element html and parse it and add data one by one to the list

Link to post
Share on other sites

You want to use xpath and specify an offset, since you didn't post code here is a basic example:

set(#html,"<section>
<span class=\"mapMeta\">
<span title=\"3\"/>
<span title=\"4/5\"/>
</span>
</section>

<section>
<span class=\"mapMeta\">
<span title=\"3 star hotel\"/>
</span>
</section>","Global")
set(#example,$plugin function("XpathPlugin.dll", "$Generic Xpath Parser", #html, "//span[@class=\'mapMeta\']/span[2]", "title", ""),"Global")
Link to post
Share on other sites
  • 4 weeks later...

I always plan for the data to not be there and I will show "No data at XYZ".  So when it is there I will grab it and show it.

 

In other words you have to build in Error checks to avoid issues overall.

 

Buddy

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