/ settings / ads /在抓取Google时保持弹出状态

时间:2016-04-17 23:16:59

标签: ruby web-scraping

我有一个欺骗Google的程序,它是一个使用int BufferSize = <some size>; array<byte> ^bytes = gcnew array<byte>(BufferSize); int available = serialPort->BytesAvailable; serialPort->Read(bytes, 0, Math::Min(available, BufferSize)); 搜索Google的开源漏洞搜寻器。它使用文本文件中提供的随机搜索查询来决定要搜索的内容。

由于程序的大小,我会发布主文件和git的链接。

无论如何,我有这个用于搜索网站的程序,然而,当它不时地刮擦时它会遇到一个&#39; URL&#39; (我轻描淡写)看起来像这样:

mechanize

当显示时,它会完全崩溃程序。我尝试过以下操作:

[17:05:02 INFO]I'll run in default mode!
[17:05:02 INFO]I'm searching for possible SQL vulnerable sites, using search query inurl:/main.php?f1=

[17:05:04 SUCCESS]Site found: http://forix.autosport.com/main.php?l=0&c=1
[17:05:05 SUCCESS]Site found: https://zweeler.com/formula1/FantasyFormula12016/main.php?ref=103
[17:05:06 SUCCESS]Site found: https://en.zweeler.com/formula1/FantasyFormula1YearGame2015/main.php
[17:05:07 SUCCESS]Site found: http://modelcargo.com/main.php?mod=sambachoose&dep=samba
[17:05:08 SUCCESS]Site found: http://www.ukdirt.co.uk/main.php?P=rules&f=8
[17:05:09 SUCCESS]Site found: http://www.ukdirt.co.uk/main.php?P=tracks&g=2&d=2&m=0
[17:05:11 SUCCESS]Site found: http://zoohoo.sk/redir.php?q=v%FDsledok&url=http%3A%2F%2Flivescore.sk%2Fmain.php%3Flang%3Dsk
[17:05:12 SUCCESS]Site found: http://www.chemical-plus.com/main.php?f1=pearl_pigment.htm
[17:05:13 SUCCESS]Site found: http://www.fantasyf1.co/main.php
[17:05:14 SUCCESS]Site found: http://www.escritores.cl/base.php?f1=escritores/main.php
[17:05:15 SUCCESS]Site found: /settings/ads/preferences?hl=en #<= Right here

然而,它不断涌现。另外我应该提一下,最后5个字符取决于你的位置,到目前为止我已经看到了:

next if urls == '/settings/ads/preferences?hl=en'
next if urls =~ /preferences?hl=en/
next if urls.split('/')[2] == 'ads/preferences?hl=en'

有没有人知道这是什么,我做过一些研究,实际上找不到任何东西。任何帮助都会很棒。

主要来源:

hl=en
hl=ru
hl=ia

此代码中是否有任何内容会导致随机弹出?它只发生在随机搜索查询中。

Link to GitHub

更新

我发现Googles广告服务链接在其URL中具有与给我问题的链接相同的扩展名。但是,这并不能解释为什么我得到这个链接,以及为什么我可以&#39;似乎跳过了它。

1 个答案:

答案 0 :(得分:1)

urls = "settings/ads/preferences?hl=ru"

if urls =~ /settings\/ads\/preferences\?hl=[a-z]{2}/
    p "I'm skipped"
end

=> "I'm skipped"