Kreatus (Ubot Ninja) 422 Posted October 1, 2011 Report Share Posted October 1, 2011 I need to scrape the keyword availability in this site www.namechk.com Here is my current code to scrape facebook availability status which is doesnt work.navigate("http://namechk.com/", "Wait") type text(<placeholder="type username here">, "dad3dsad", "Standard") click(<class="pretty">, "Left Click", "No") wait(4) wait for browser event("Everything Loaded", "") set(#facebook status, $page scrape("<div class=\"", "\" style=\"display: block; top: 30px; left: 0px; \"><div class=\"img\" style=\"background-position: 0 -768px\"> </div><a href=\"http://www.facebook"), "Global") This should scrape right in ubot3.5. I am looking to get the class status only. Here is the source code of the DIV . Bolded text is the one that I want to scrape. <div class="site available" style="display: block; top: 30px; left: 0px; "><div class="img" style="background-position: 0 -768px"> </div><a href="http://www.facebook.com/" class="name" target="_blank">Facebook</a></div> Thanks Quote Link to post Share on other sites
LoWrIdErTJ - BotGuru 904 Posted October 1, 2011 Report Share Posted October 1, 2011 load html("<div class=\"site available\" style=\"display: block; top: 30px; left: 0px; \"><div class=\"img\" style=\"background-position: 0 -768px\"> </div><a href=\"http://www.facebook.com/\" class=\"name\" target=\"_blank\">Facebook</a></div>") set(#facebook status, $page scrape("<div class=\"", "\" style=\"display: block; top: 30px; left: 0px; \">"), "Global") ui stat monitor("status", #facebook status) Quote Link to post Share on other sites
Kreatus (Ubot Ninja) 422 Posted October 1, 2011 Author Report Share Posted October 1, 2011 Thanks. But that code will only work on that loaded html. It doesnt work on the actual page result. Quote Link to post Share on other sites
LoWrIdErTJ - BotGuru 904 Posted October 1, 2011 Report Share Posted October 1, 2011 I would need to know where and how I can access the page result to pull it properly. Quote Link to post Share on other sites
Kreatus (Ubot Ninja) 422 Posted October 1, 2011 Author Report Share Posted October 1, 2011 Just paste the first code I posted on code view it should navigate to the test result. Quote Link to post Share on other sites
LoWrIdErTJ - BotGuru 904 Posted October 1, 2011 Report Share Posted October 1, 2011 ui stat monitor("status = ", #facebook status) navigate("http://namechk.com/", "Wait") type text(<placeholder="type username here">, "dad3dsad", "Standard") click(<class="pretty">, "Left Click", "No") wait(4) wait for browser event("Everything Loaded", "") set(#facebook status, $scrape attribute(<style="display: block; top: 30px; left: 0px; ">, "class"), "Global") 1 Quote Link to post Share on other sites
odeesuba 24 Posted October 1, 2011 Report Share Posted October 1, 2011 here you go navigate("http://namechk.com/", "Wait") type text(<placeholder="type username here">, "dad3dsad", "Standard") click(<class="pretty">, "Left Click", "No") wait(4) wait for browser event("Everything Loaded", "") set(#facebook status, $scrape attribute(<innertext=" Facebook">, "class"), "Global") 1 Quote Link to post Share on other sites
Kreatus (Ubot Ninja) 422 Posted October 1, 2011 Author Report Share Posted October 1, 2011 Great! Actually that is what I am thinking to do earlier but when I cant find "class" on "Attribute to scrape" I thought its not possible to accomplish with "Scrape attribute" So I moved on with $pagescrape. Now I know that its possible to specify attribute to scrape. Thanks Quote Link to post Share on other sites
odeesuba 24 Posted October 1, 2011 Report Share Posted October 1, 2011 Great! Actually that is what I am thinking to do earlier but when I cant find "class" on "Attribute to scrape" I thought its not possible to accomplish with "Scrape attribute" So I moved on with $pagescrape. Now I know that its possible to specify attribute to scrape. Thanks It was a nice exercise, but TJ was faster. Quote Link to post Share on other sites
LoWrIdErTJ - BotGuru 904 Posted October 1, 2011 Report Share Posted October 1, 2011 End result is all the same. Nice job all around. This is what I like about the activity in this forum the most. Is the help people give. 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.