Urgent Enquirer 0 Posted September 5, 2021 Report Share Posted September 5, 2021 Hi, Consider this snippet ... add list to list($scrape attribute(<outerhtml=w"<span>*</span>">,"innertext"),%keywords,"Delete","Global") Is not the keywords google suggest are supposed to be scraped to the %keywords list ? Yes or no ? So why debugger showing me "$scrape attribute" has scraped keywords with a line break inbetween each keyword. Like so: brute force brute power etc. Why the line break ? The debugger is listing like this. Terrible! Another issue is that, the debugger shows the %keywords list is empty. Why empty since $scrape attribute has found about 20 keywords and I set the code for $scrape attribute to dump the scraped items to the %keywords list ? Here's the full code. On the url field, type "http://www.google.com" without the quotes. On the keywords field, type "brute force" without the quotes. In the dropdown UI, select "20" results. Run the code. Check the debugger. ui text box("Url",#ui textbox_url) ui text box("Keywords",#ui textbox_keywords) ui drop down("Max Results","10,20,30,40,50,60,70,80,90,100",#ui dropdown_max results) ui save file("Save To",#ui save file_save to) ui stat monitor("Total Results",$list total(%keywords)) divider divider set(#max results,#ui dropdown_max results,"Global") set(#navigate,#ui textbox_url,"Global") set(#keywords,#ui textbox_keywords,"Global") set(#save to,#ui save file_save to,"Global") divider navigate(#navigate,"Wait") wait for element(<type="text">,"","Appear") wait for element(<type="submit">,"","Appear") wait($rand(1,5)) if($exists(<type="text">)) { then { change attribute(<type="text">,"value",$nothing) wait($rand(1,5)) type text(<type="text">,#keywords,"Standard") wait($rand(1,5)) } else { alert("ERROR ALERT: Cannot detect \"Search Box\"! Quitting the session.") stop script } } clear list(%keywords) add list to list($scrape attribute(<outerhtml=w"<span>*</span>">,"innertext"),%keywords,"Delete","Global") save to file(#save to,%keywords) Quote Link to post Share on other sites
PRO 69 Posted September 5, 2021 Report Share Posted September 5, 2021 I tested your code. And no, there is no bug. You only confused how to use the "add list to list" command here. This: add list to list($scrape attribute(<outerhtml=w"<span>*</span>">,"innertext"),%keywords,"Delete","Global") Should be this: add list to list(%keywords,$scrape attribute(<outerhtml=w"<span>*</span>">,"innertext"),"Delete","Global") 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.