Jump to content
UBot Underground

Recommended Posts

Hi all

 

I would like to scrappe the google serp urls.

 

This code from 'search result scrapper' (by Kreatus) was working fine.

But it not working now (i  think google have change his page) 

 

    if($comparison(#current total"<"#total results)) {
        then {
            if($search page("onmousedown=\"return rwt(this")) {
                then {
                    add list to list(%result urls$scrape attribute(<outerhtml=w"<a href=\"*\" class=\"*\" onmousedown=\"return rwt(this*)\">*</a>">, "href"), "Delete", "Global")
                }
                else {
                    add list to list(%result urls, $page scrape("<a href=\"/url?q=", "&sa="), "Delete", "Global")
                }
            }
            click(<style="background-position:-96px 0;width:71px">"Left Click""No")
            wait for browser event("DOM Ready""")
        }
        else {
        }
    }

 

I think the wrong code is there :

$scrape attribute(<outerhtml=w"<a href=\"*\" class=\"*\" onmousedown=\"return rwt(this*)\">*</a>">, "href")

 

Is someone got the solution ?

Link to post
Share on other sites

This should work.

 

clear list(%result urls)
clear list(%final url)
if($comparison(#current total"<"#total results)) {
    then {
        if($search page("onmousedown=\"return rwt(this")) {
            then {
                add list to list(%result urls$scrape attribute(<tagname="h3">"outerhtml"), "Delete""Global")
            }
            else {
                add list to list(%result urls$page scrape("<a href=\"/url?q=""&sa="), "Delete""Global")
            }
        }
        click(<style="background-position:-96px 0;width:71px">"Left Click""No")
        wait for browser event("DOM Ready""")
    }
    else {
    }
}
loop($list total(%result urls)) {
    add item to list(%final url$find regular expression($next list item(%result urls), "(?<=href=\").*?(?=\" onmousedown)"), "Delete""Global")
}
load html($replace($text from list(%final url"
"), "
""<br>"))

  • Like 1
Link to post
Share on other sites

Hi, i am back

 

There is somethink wrong in :

 

loop($list total(%result urls)) {
    add item to list(%final url$find regular expression($next list item(%result urls), "(?<=href=\").*?(?=\" onmousedown)"), "Delete""Global")
}

 

It does not correctly find the "http... etc"

Link to post
Share on other sites

Only fairly new to Ubot so can someone explain the code above if it is working for some people as there appears to be no navigation module so there must be something missing?

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