News for hackers. Stuff that matters.
Re:Google Deactivates Web Search API by oneeyedpigeon on Wednesday May 04, 2016 @04:21AM (#11626959)
God, page scraping is horrible at the best of times but, as anyone who's ever viewed source on one of their pages must be thinking, scraping Google markup must be hell-on-earth.
Re:Google Deactivates Web Search API by Ixiaus on Wednesday May 04, 2016 @09:43AM (#11628243)
It was indeed pretty rough it wouldn't surprise me if Google moves to js generated dom elements to combat rank trackers, at the time it was fine because they want to service non-js browsers but that might change.

Parsing it wasn't hard but it wasn't fun...

Re:Google Deactivates Web Search API by slig on Wednesday May 04, 2016 @10:40AM (#11628654)
Wouldn't it be easier if they generated the dom elements via JS? That would imply that they're getting a JSON or something like, parsing it and creating the DOM.
Re:Google Deactivates Web Search API by Ixiaus on Thursday May 05, 2016 @08:51AM (#11635594)
No because then you'd have to use a headless browser that can execute js. That increases time and cost when scraping, though it wouldn't surprise me if it ends up going that way.
Re:Google Deactivates Web Search API by slig on Thursday May 05, 2016 @09:27AM (#11635858)
Why execute the JS? Just parse the JSON (I'm just guessing here). No need to mess with DOM or JS.
Re:Google Deactivates Web Search API by Ixiaus on Thursday May 05, 2016 @05:00PM (#11639637)
From my last and admittedly cursory look it wasn't that simple. IIRC JSON wasn't even used, I think it was a binary protocol.
Re:Google Deactivates Web Search API by userbinator on Wednesday May 04, 2016 @07:35AM (#11627606)
If you have an HTML parser, it's just a matter of selecting the right DOM nodes.
Re:Google Deactivates Web Search API by audiohihack on Saturday May 07, 2016 @10:04PM (#11652267)
Def not that easy with Google. It is not uncommon to see 20+ serp variations on a given day if you are crawling at high volume, changing user agents, etc. The whole process is fairly terrible to parse consistently.
Re:Google Deactivates Web Search API by oneeyedpigeon on Wednesday May 04, 2016 @10:13AM (#11628471)
Yes, but if your markup is spaghetti, "selecting the right DOM nodes" becomes a lot more difficult.