动态爬行vbulletin的问题

时间:2012-05-02 13:10:03

标签: python html screen-scraping web-crawler scrapy

免责声明:借口证明我的愚蠢,但我不是网络程序员:D

我正在尝试使用python scrapy编写一个爬虫。当我看到这个vbulletin板时,我遇到了一些奇怪的行为。当我在firefox中加载页面并使用firefox / firebug检查它时,我看到论坛L1标题有类forumbit_nopost new L1(您可以在文档中搜索cat117以获取感兴趣的元素)。

当我使用scrappy或curl检索文档时,我将类设置为forumbit_nopost old L1。我在使用curl时更改了用户代理以匹配firefox,并且它没有任何区别,因此我怀疑它与某些javascript执行有关。我试过在firefox中禁用javascript,但是firefox仍然有源类,它具有class属性的new变体。

有人可以向我解释发生了什么事吗? :D

P.s。,chrome也会看到old变体。

使用curl命令:

curl http://forums.heroesofnewerth.com/index.php --user-agent "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:12.0) Gecko/20100101 Firefox/12.0" > scratch

1 个答案:

答案 0 :(得分:0)

我敢打赌,新的意味着自上次访问以来有新的帖子。除非在会话之间保留cookie,否则您的脚本将永远不会显示此内容。