我知道这很奇葩。。但是导师让做。
我试了下curl和scrapy shell都看不到内容。。。难道需要selenium模拟?
我试了下curl和scrapy shell都看不到内容。。。难道需要selenium模拟?
|
lianyueJun 13, 2015
1
google 有伐限制爬多了点 就。。。。 验证码 我记得 google 有ajax 的搜索api json格式的 自己找找吧
|
|
lincanbinJun 13, 2015
2
|
|
Andy1999Jun 13, 2015 via iPhone
3
会限制的
|
|
dong3580Jun 13, 2015 via Android
5
嵌套一个webbrower控件试试,应该可以,C#里面有ms提供的,其他语言的话不清楚。谷歌搜索检测太多,多玩几次就会干掉。一楼说的那个ajax,每页返回4条,一共18到20页结果,再请求就不行了。
|
|
binuxJun 13, 2015
7
不要爬桌面版
|
|
elgoogJun 13, 2015
8
API不行?
|
|
gdwestJun 13, 2015 via iPhone
9
这个问题你要@国内各大搜索引擎
|
|
zhjitsJun 13, 2015
10
Pricing
JSON/Atom Custom Search API pricing and quotas depend on the engine's edition: Custom Search Engine (free) For CSE users, the API provides 100 search queries per day for free. If you need more, you may sign up for billing in the Developers Console. Additional requests cost $5 per 1000 queries, up to 10k queries per day. Google Site Search (paid). For detailed information on GSS usage limits and quotas, please check GSS pricing options. |
|
icedxJun 13, 2015
11
有
|
|
icedxJun 13, 2015
12
V2EX 不支持缩进 所以你把下面两行代码贴到Python 中就能看到解决方法了
Code="""import[Space]requests\n\nConf_UseProxy=0\n\nHeaders={'User-Agent':'Mozilla/4.0[Space](Windows;[Space]MSIE[Space]6.0;[Space]Windows[Space]NT[Space]5.2)'}\n\nif[Space]Conf_UseProxy==1:\n[Space]import[Space]socks[Space]\n[Space]import[Space]socket[Space]\n[Space]socks.set_default_proxy(socks.SOCKS5,'localhost',1079,rdns=True)[Space]\n[Space]socket.socket[Space]=[Space]socks.socksocket\n\ndef[Space]GetGoogle(KeyWord):\n[Space]Url='https://www.google.com/search?q='+KeyWord\n[Space]Response=requests.get(Url,headers=Headers)\n[Space]print[Space]Response.content\n\nGetGoogle('QueenSamaprpr')""" print Code.replace('\\n','\n').replace('[Space]',' ') |
|
icedxJun 13, 2015
15
这个不是对楼主说的: 不要吐槽我的代码风格, 你们那些个没解决问题的没资格吐槽我的代码风格!(指
这个才是对楼主说的: 翻页的参数是: &start=(目标页数-1)*10 |
|
icedxJun 13, 2015
16
|