mohsinx1x 0 Posted April 29, 2018 Report Share Posted April 29, 2018 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! Quote Link to post Share on other sites
bestmacros 60 Posted April 29, 2018 Report Share Posted April 29, 2018 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 Quote Link to post Share on other sites
HelloInsomnia 1103 Posted April 29, 2018 Report Share Posted April 29, 2018 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") Quote Link to post Share on other sites
Code Docta (Nick C.) 638 Posted April 29, 2018 Report Share Posted April 29, 2018 You need to normalize the data.If element == nothing: put something as a place holder like a 0(zero) or empty this will make your data = Regards,CD Quote Link to post Share on other sites
UBotBuddy 331 Posted May 27, 2018 Report Share Posted May 27, 2018 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 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.