想用python写一个登录51job获取信息的脚本
用chrome看了一下登录的过程,发现登录时的url为:
Request URL:http://my.51job.com/15089387965614251838/my/My_Pmc.php
我想问一下上面代码里的url参数15089387965614251838应该怎么获取?
我的代码:
myCookie = urllib2.HTTPCookieProcessor(cookielib.CookieJar());
opener = urllib2.build_opener(myCookie)
post_data = {
'username':'user',
'userpwd':'pwd',
'url':'',
'x':'45',
'y':'17'
}
#'http://my.51job.com/my/My_SignIn.php'
#url = 'http://my.51job.com/24101876372437709800/my/My_Pmc.php' #这个要输入验证码
url = 'http://my.51job.com/my/My_SignIn.php' #用这个url登录失败
req = urllib2.Request(url, urllib.urlencode(post_data))
html_src = opener.open(req).read()
'http://my.51job.com/'
<form action="http://my.51job.com/39515986399789422305/my/My_Pmc.php" method="post" name="signin" id="signin"