Python batch query keywords is the index word


# gets token,

password = ”;

urllib2.install_opener (opener);

# set the username and password of


import cookielib

URL_BAIDU_INDEX = u’贵族宝贝baidu贵族宝贝/’;

URL_BAIDU_TOKEN =’https://passport.baidu贵族宝贝/v2/api/? Getapi& tpl=pp& apiver=v3& class=login’;

# set cookie, where cookiejar is managed automatically, without specifying the

import re

# -*-

opener = urllib2.build_opener (urllib2.HTTPCookieProcessor (CJ));

reqReturn = urllib2.urlopen (URL_BAIDU_INDEX);


tokenReturn = urllib2.urlopen (URL_BAIDU_TOKEN);

import bs4

CJ = cookielib.CookieJar (

URL_BAIDU_LOGIN =’https://passport.baidu贵族宝贝/v2/api/ Login’;

simple query is a keyword index, cannot query index, study time under

matchVal = (u’" token" "

coding: UTF-8 -*-

username = ”;

import urllib2

import urllib

#https://passport.baidu贵族宝贝/v2/api/? Getapi& class=login& tpl=mn& tangram=true can also use this

Leave a comment

Your email address will not be published. Required fields are marked *