我试图使用Google App Engine的urlFetch服务获取网址并实施代理网站。像Twitter和Facebook这样的网站似乎毁容了,就好像他们错过了样式表一样,即使Google错过了Google徽标,但Yahoo打开了一切正常,我不明白为什么。无法使用Google App Engine的urlfetch打开Twitter
0
A
回答
1
当您使用urlfetch时,它会提取页面的HTML,而不是图像,CSS,JavaScript或任何其他资源。
雅虎看起来很好,大概是因为他们使用绝对URLS(例如http://www.yahoo.com/image.png)指定了他们的图片和CSS,所以当您的urlfetch'd页面显示时,它包含来自yahoo.com的完整图片URL。请记住,当某人无法访问yahoo.com时,这些图片也不会出现在您的代理页面上。
编辑:它看起来像雅虎将其CSS插入HTML页面本身,这将解释为什么它在您的获取副本中工作。因为他们的CSS /图像被指定为相对URL(例如,/image.png)
谷歌似乎没有CSS /图像,并且您的代理根本不/image.png
你有一个形象必须解析urlfetch的页面内容才能找到需要提取和代理的图像和CSS。只要确保处理像/resource.png这样的相对URL以及绝对URL(例如www.foo.com/resource.png)。
相关问题
- 1. Google App Engine urlfetch循环
- 2. 导入urlfetch无法在Jython Google App Engine上工作
- 3. Google App Engine - urlFetch地址不在_netblocks.google.com
- 4. Google App Engine的urlfetch是否有任何方式打开并保持开启Twitter Streaming API连接?
- 5. PHP Google App Engine无法在本地打开_ah/start
- 6. 如何更改Google App Engine UrlFetch服务上的用户代理?
- 7. 如何从Google App Engine的urlfetch获取部分结果?
- 8. 如何禁止Google App Engine中的urlfetch标头警告?
- 9. 使用Google App Engine如何打开html页面?
- 10. 加速UrlFetch Google App脚本?
- 11. 无法在Google App Engine上部署Android App Engine项目
- 12. 在Python中将图像插入Picasa Google App Engine Sdk通过urlfetch
- 13. 使用实体 - Google App Engine
- 14. Google App Engine使用maven
- 15. Google App Engine PHP,无法解析主机
- 16. Jinja2无法在Google App Engine上导入
- 17. Google App Engine无法解析www.facebook.com
- 18. 无法导入Google App Engine Api
- 19. 使用异步的App Engine上的网页charcode提取UrlFetch
- 20. CURRENT Google App Engine无法使用BlazeDS的哪些功能?
- 21. Google App Engine queue.yaml无法在开发服务器上工作
- 22. App Engine Python的Twitter库?
- 23. 在App Engine上制作代理服务器后的URLFetch
- 24. Google App Engine
- 25. Google App Engine Memcache
- 26. Google App Engine DeobfuscatorBuilder
- 27. Google App Engine Profiler
- 28. Google App Engine ASP.net
- 29. Google App Engine ThreadSafe
- 30. Python - Google App Engine
是的,我想到了以后。我想我可以取得CSS并将它放在内联的地方,但不是如何去图像? – 2010-03-31 18:23:43
当您在页面中找到图像时,也可以获取图像并将其存储在代理中。然后重写页面的属性以指向您的代理图像而不是原始图像。为了简单起见,我会用CSS和其他资源来做到这一点。 – 2010-03-31 18:28:10
,我猜想使用css显示的图像链接也必须改变,这是一个工作! – 2010-04-01 06:31:02