[英]Getting content from Google News
Can I get text from news.google.com? 我可以从news.google.com获得文字吗? When I view code, I see that it's JavaScript, so I can't get the text on the page.
当我查看代码时,我看到它是JavaScript,因此无法在页面上获取文本。 Can anybody can help me?
有人可以帮我吗?
Try the RSS feeds. 试试RSS提要。 See:
看到:
http://www.google.com/support/news/bin/answer.py?hl=en&answer=59255 http://www.google.com/support/news/bin/answer.py?hl=zh_CN&answer=59255
Adding &output=rss
to the end of many Google News URLs allows you to get the results in an XML/RSS format instead of as a mix of JavaScript and HTML. 在许多Google新闻URL的末尾添加
&output=rss
,您可以XML / RSS格式获取结果,而不是将JavaScript和HTML混合使用。
For example, http://news.google.co.th/news/search?&q=facebook&output=rss . 例如, http://news.google.co.th/news/search?&q=facebook&output=rss 。
PHP has a variety of XML libraries that could be used to parse the content, but I am not familiar enough with them to produce example code. PHP有各种XML库可用于解析内容,但是我对它们不熟悉,无法生成示例代码。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.