Kev 69 Posted May 18, 2018 Report Share Posted May 18, 2018 Hi all, Been a while since I fired up ubot and need to do a small bot for scraping ads that have a phone number in them, specifically click to call. These are viewed on iPhone user agent.Could anyone help me with the script to scrape just the ads that have the phone number icon in them like you can see in the screenshot Here's what I am working with currently: clear list(%ads) set user agent("iPhone") ui text box("Search",#keyword) navigate("http://google.ie","Wait") wait for browser event("Page Loaded","") type text(<name="q">,#keyword,"Standard") wait(1) click(<name="btnG">,"Left Click","No") wait for browser event("Page Loaded","") add list to list(%ads,$scrape attribute(<innerhtml=w"<a href=\"javascript:void(0)\" onclick=\"(function()\{var au=\'/aclk?*\';var pu=\'tel:*\';google.load(\'mad\',function()\{google.mad.bd(au,pu);\});\})();\" data-ved=\"*\">*</a>">,"innertext"),"Delete","Global") clear list(%ads) scrape table(<tagname="ol">,&ads) add list to list(%ads,$scrape attribute(<innerhtml=w"<li class=\"ads-ad RTUwJd\"><h3><a href=\"/aclk?sa=l&ai=*</li>">,"innertext"),"Delete","Global") Here's a screenshot of what I need to scrape: Thanks in advance! Quote Link to post Share on other sites
pash 504 Posted May 21, 2018 Report Share Posted May 21, 2018 try add list to list(%ads,$scrape attribute(<(class=w"ads-ad*" AND innertext=w"*CALL*")>,"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.