开发者

Can I use google web cache to programatically open a page?

开发者 https://www.devze.com 2023-02-11 00:11 出处:网络
I\'m using snoopy and phpQuery. If I have a URL, i\'d like to open up the cached version of that url on google. Any date, doesn\'t matter, as long as a version exists i\'ll take it.

I'm using snoopy and phpQuery. If I have a URL, i'd like to open up the cached version of that url on google. Any date, doesn't matter, as long as a version exists i'll take it.

Any ideas on how to do this?

To manually replicate this:

  1. Select your url, lets say http://www.abc.net.au/news/infographics/qld-floods/beforeafter.htm
  2. Load up http://www.google开发者_如何学JAVA.com.au
  3. Type in this url in the search box
  4. The first result is the url, click "Cache" underneath it.

So I want to grab that URL, which looks like this:

http://webcache.googleusercontent.com/search?q=cache:BOtHTvfch7UJ:www.abc.net.au/news/infographics/qld-floods/beforeafter.htm+http://www.abc.net.au/news/infographics/qld-floods/beforeafter.htm&cd=1&hl=en&ct=clnk&gl=au&source=www.google.com.au


Okay just worked it out

http://webcache.googleusercontent.com/search?q=cache:http://www.abc.net.au/news/infographics/qld-floods/beforeafter.htm &hl=en &strip=1

strip=1 will load the page without css or javascript (I'm guessing it's what the robot sees?).

That's awesome. google rocks.

0

精彩评论

暂无评论...
验证码 换一张
取 消