Jump to content
UBot Underground

How to scrape this on ubot4


Recommended Posts

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

Link to post
Share on other sites
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)

Link to post
Share on other sites
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")

  • Like 1
Link to post
Share on other sites

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")

  • Like 1
Link to post
Share on other sites

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

Link to post
Share on other sites

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

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