SweTech 4 Posted February 16, 2020 Report Share Posted February 16, 2020 Hi!I have scraped 50 member urls to a list. I want to loop through each one of them and on every single url save name, email and phone number that is displayed on each member page. My end goal is to be able to open them in a neat excel table. I have no problem achieving the loop part but I'm not sure how to save the scrape of the name, email and phone number. Should I save each element (name, email etc) to unique variables and then save them to a list? Should I create one list per data type and then combine them after the scrape? Should I somehow scrape them and put them in a table straight away?I'm using the xpath plugin for the scrape of the elements. Thanks in advance Quote Link to post Share on other sites
FallingDown 2 Posted February 16, 2020 Report Share Posted February 16, 2020 Add to table with the row number as an incrementing variable. Sent from my LG-H932 using Tapatalk Quote Link to post Share on other sites
stanf 43 Posted February 16, 2020 Report Share Posted February 16, 2020 use xpath to scrape the block of data that has all the infoloop thru each block and parse out the data you need and the save each each variableand repeat until done. Quote Link to post Share on other sites
SweTech 4 Posted February 16, 2020 Author Report Share Posted February 16, 2020 use xpath to scrape the block of data that has all the infoloop thru each block and parse out the data you need and the save each each variableand repeat until done. don't think I really understand what you mean tbh... 1 Quote Link to post Share on other sites
Code Docta (Nick C.) 638 Posted February 27, 2020 Report Share Posted February 27, 2020 Normalize the data define $phone { set(#F_pjhone,$plugin function("XpathPlugin.dll", "$Generic Xpath Parser", $document text, "//li", "InnerText", ""),"Global") if($comparison(#F_pjhone,"= Equals",$nothing)) { then { return("NA") } else { comment("returns user name if not blank") return(#F_phone) } } } define $user name { set(#F_user_name,$plugin function("XpathPlugin.dll", "$Generic Xpath Parser", $document text, "//li", "InnerText", ""),"Global") if($is blank(#F_user_name)) { then { return("NA") } else { comment("returns user name if not blank") return(#F_user_name) } } } add item to list(%data,"{$user name()},{$phone()}","Don\'t Delete","Global") $is blank is an bot bank function, sub neededuse $comparison instead if neededRegards,Nick 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.