Kr1s77 / awesome-python-login-model

😮python模拟登陆一些大型网站,还有一些简单的爬虫,希望对你们有所帮助❤️,如果喜欢记得给个star哦🌟
Other
15.84k stars 3.28k forks source link

求解惑 #52

Open shenxianxgg opened 5 years ago

shenxianxgg commented 5 years ago

def getUUID(): global uuid, session

url = 'https://login.weixin.qq.com/jslogin'
params = {
    'appid': 'wx782c26e4c19acffb',
    'fun': 'new',
    'lang': 'zh_CN',
    '_': int(time.time()),
}

请问 params 里面的参数是怎么获取的。我放在我本地运行总是报错。获取不到对的结果

real-re commented 5 years ago

re库

On Sat, Apr 13, 2019, 3:12 PM shenxianxgg notifications@github.com wrote:

def getUUID(): global uuid, session

url = 'https://login.weixin.qq.com/jslogin'

params = {

'appid': 'wx782c26e4c19acffb',

'fun': 'new',

'lang': 'zh_CN',

'_': int(time.time()),

}

请问 params 里面的参数是怎么获取的。我放在我本地运行总是报错。获取不到对的结果

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/CriseLYJ/awesome-python-login-model/issues/52, or mute the thread https://github.com/notifications/unsubscribe-auth/ApI2hJqfsZX7ILE9jb_vfhPTU24Mbqoxks5vgYN5gaJpZM4ct5GK .

shenxianxgg commented 5 years ago

找到原因了。是因为我代码的缩进有问题

session = requests.session() url = 'https://login.weixin.qq.com/jslogin' params = { 'appid': 'wx782c26e4c19acffb', 'fun': 'new', 'lang': 'zhCN', '': int(time.time()), } response = session.get(url) print(response.content.decode('utf-8')) 这样子就可以生效了。

shenxianxgg commented 5 years ago

re库

代码缩进问题

shenxianxgg commented 5 years ago

请问大佬 appid怎么取到的? 怎么知道访问这个地址需要传入那些参数呢?

Dustyposa commented 5 years ago

请问大佬 appid怎么取到的? 怎么知道访问这个地址需要传入那些参数呢?

1.第一个问题不太清楚你在弄哪个接口. 2.第二个问题,你找到请求的地址,查看请求头,就能确定需要哪些参数,需要注意的是,get请求的参数在网址中,如果用requests库的话,可以将参数放在 params={"key": "value"} requests.get(url, params=params) # params参数中

shenxianxgg commented 5 years ago

请问大佬 appid怎么取到的? 怎么知道访问这个地址需要传入那些参数呢?

1.第一个问题不太清楚你在弄哪个接口. 2.第二个问题,你找到请求的地址,查看请求头,就能确定需要哪些参数,需要注意的是,get请求的参数在网址中,如果用requests库的话,可以将参数放在 params={"key": "value"} requests.get(url, params=params) # params参数中

根据您讲的完全没看出来定义这个方法传入的这几个参数的意义 😳 def getUUID(): global uuid, session

url = 'https://login.weixin.qq.com/jslogin'
params = {
    'appid': 'wx782c26e4c19acffb',
    'fun': 'new',
    'lang': 'zh_CN',
    '_': int(time.time()),
}

response = session.get(url, params=params)
# 用session对象发出一个get请求,获取cookies 

查看headers截图

image
Dustyposa commented 5 years ago

请问大佬 appid怎么取到的? 怎么知道访问这个地址需要传入那些参数呢?

1.第一个问题不太清楚你在弄哪个接口. 2.第二个问题,你找到请求的地址,查看请求头,就能确定需要哪些参数,需要注意的是,get请求的参数在网址中,如果用requests库的话,可以将参数放在 params={"key": "value"} requests.get(url, params=params) # params参数中

根据您讲的完全没看出来定义这个方法传入的这几个参数的意义 😳 def getUUID(): global uuid, session

url = 'https://login.weixin.qq.com/jslogin'
params = {
    'appid': 'wx782c26e4c19acffb',
    'fun': 'new',
    'lang': 'zh_CN',
    '_': int(time.time()),
}

response = session.get(url, params=params)
# 用session对象发出一个get请求,获取cookies 

查看headers截图

image

请求头下面还有其他部分, 往下滑动,可以看到参数

shenxianxgg commented 5 years ago

请问大佬 appid怎么取到的? 怎么知道访问这个地址需要传入那些参数呢?

1.第一个问题不太清楚你在弄哪个接口. 2.第二个问题,你找到请求的地址,查看请求头,就能确定需要哪些参数,需要注意的是,get请求的参数在网址中,如果用requests库的话,可以将参数放在 params={"key": "value"} requests.get(url, params=params) # params参数中

根据您讲的完全没看出来定义这个方法传入的这几个参数的意义 😳 def getUUID(): global uuid, session

url = 'https://login.weixin.qq.com/jslogin'
params = {
    'appid': 'wx782c26e4c19acffb',
    'fun': 'new',
    'lang': 'zh_CN',
    '_': int(time.time()),
}

response = session.get(url, params=params)
# 用session对象发出一个get请求,获取cookies 

查看headers截图

image

请求头下面还有其他部分, 往下滑动,可以看到参数

没有了。 到底部了 😢

Dustyposa commented 5 years ago

请问大佬 appid怎么取到的? 怎么知道访问这个地址需要传入那些参数呢?

1.第一个问题不太清楚你在弄哪个接口. 2.第二个问题,你找到请求的地址,查看请求头,就能确定需要哪些参数,需要注意的是,get请求的参数在网址中,如果用requests库的话,可以将参数放在 params={"key": "value"} requests.get(url, params=params) # params参数中

根据您讲的完全没看出来定义这个方法传入的这几个参数的意义 😳 def getUUID(): global uuid, session

url = 'https://login.weixin.qq.com/jslogin'
params = {
    'appid': 'wx782c26e4c19acffb',
    'fun': 'new',
    'lang': 'zh_CN',
    '_': int(time.time()),
}

response = session.get(url, params=params)
# 用session对象发出一个get请求,获取cookies 

查看headers截图

image

请求头下面还有其他部分, 往下滑动,可以看到参数

没有了。 到底部了 😢

url部分呢

shenxianxgg commented 5 years ago

请问大佬 appid怎么取到的? 怎么知道访问这个地址需要传入那些参数呢?

1.第一个问题不太清楚你在弄哪个接口. 2.第二个问题,你找到请求的地址,查看请求头,就能确定需要哪些参数,需要注意的是,get请求的参数在网址中,如果用requests库的话,可以将参数放在 params={"key": "value"} requests.get(url, params=params) # params参数中

根据您讲的完全没看出来定义这个方法传入的这几个参数的意义 😳 def getUUID(): global uuid, session

url = 'https://login.weixin.qq.com/jslogin'
params = {
    'appid': 'wx782c26e4c19acffb',
    'fun': 'new',
    'lang': 'zh_CN',
    '_': int(time.time()),
}

response = session.get(url, params=params)
# 用session对象发出一个get请求,获取cookies 

查看headers截图

image

请求头下面还有其他部分, 往下滑动,可以看到参数

没有了。 到底部了 😢

url部分呢 也没有

image
Dustyposa commented 5 years ago

请问大佬 appid怎么取到的? 怎么知道访问这个地址需要传入那些参数呢?

1.第一个问题不太清楚你在弄哪个接口. 2.第二个问题,你找到请求的地址,查看请求头,就能确定需要哪些参数,需要注意的是,get请求的参数在网址中,如果用requests库的话,可以将参数放在 params={"key": "value"} requests.get(url, params=params) # params参数中

根据您讲的完全没看出来定义这个方法传入的这几个参数的意义 😳 def getUUID(): global uuid, session

url = 'https://login.weixin.qq.com/jslogin'
params = {
    'appid': 'wx782c26e4c19acffb',
    'fun': 'new',
    'lang': 'zh_CN',
    '_': int(time.time()),
}

response = session.get(url, params=params)
# 用session对象发出一个get请求,获取cookies 

查看headers截图

image

请求头下面还有其他部分, 往下滑动,可以看到参数

没有了。 到底部了 😢

url部分呢 也没有

image

..源网址错了...不是这个网址,肯定是wx登录页面的网址呀..怎么会是这个...

shenxianxgg commented 5 years ago

请问大佬 appid怎么取到的? 怎么知道访问这个地址需要传入那些参数呢?

1.第一个问题不太清楚你在弄哪个接口. 2.第二个问题,你找到请求的地址,查看请求头,就能确定需要哪些参数,需要注意的是,get请求的参数在网址中,如果用requests库的话,可以将参数放在 params={"key": "value"} requests.get(url, params=params) # params参数中

根据您讲的完全没看出来定义这个方法传入的这几个参数的意义 😳 def getUUID(): global uuid, session

url = 'https://login.weixin.qq.com/jslogin'
params = {
    'appid': 'wx782c26e4c19acffb',
    'fun': 'new',
    'lang': 'zh_CN',
    '_': int(time.time()),
}

response = session.get(url, params=params)
# 用session对象发出一个get请求,获取cookies 

查看headers截图

image

请求头下面还有其他部分, 往下滑动,可以看到参数

没有了。 到底部了 😢

url部分呢 也没有

image

..源网址错了...不是这个网址,肯定是wx登录页面的网址呀..怎么会是这个...

你可以看下webweixin的源码。就是模拟微信登陆的这个。getUUID里面的这个方法

Dustyposa commented 5 years ago

请问大佬 appid怎么取到的? 怎么知道访问这个地址需要传入那些参数呢?

我看了一下 是没有给分析过程,所以可能不太清楚参数。你需要分析过程吗?昨天在写提取教程,没来得及回复。

shenxianxgg commented 5 years ago

如果可以的话 最好给一份

------------------ 原始邮件 ------------------ 发件人: "Dustyposa"notifications@github.com; 发送时间: 2019年4月15日(星期一) 中午1:26 收件人: "CriseLYJ/awesome-python-login-model"awesome-python-login-model@noreply.github.com; 抄送: "upperone"1114181244@qq.com; "Author"author@noreply.github.com; 主题: Re: [CriseLYJ/awesome-python-login-model] 求解惑 (#52)

请问大佬 appid怎么取到的? 怎么知道访问这个地址需要传入那些参数呢?

我看了一下 是没有给分析过程,所以可能不太清楚参数。你需要分析过程吗?昨天在写提取教程,没来得及回复。

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

Dustyposa commented 5 years ago

如果可以的话 最好给一份 ------------------ 原始邮件 ------------------ 发件人: "Dustyposa"notifications@github.com; 发送时间: 2019年4月15日(星期一) 中午1:26 收件人: "CriseLYJ/awesome-python-login-model"awesome-python-login-model@noreply.github.com; 抄送: "upperone"1114181244@qq.com; "Author"author@noreply.github.com; 主题: Re: [CriseLYJ/awesome-python-login-model] 求解惑 (#52) 请问大佬 appid怎么取到的? 怎么知道访问这个地址需要传入那些参数呢? 我看了一下 是没有给分析过程,所以可能不太清楚参数。你需要分析过程吗?昨天在写提取教程,没来得及回复。 — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

好的。

Dustyposa commented 5 years ago

如果可以的话 最好给一份 ------------------ 原始邮件 ------------------ 发件人: "Dustyposa"notifications@github.com; 发送时间: 2019年4月15日(星期一) 中午1:26 收件人: "CriseLYJ/awesome-python-login-model"awesome-python-login-model@noreply.github.com; 抄送: "upperone"1114181244@qq.com; "Author"author@noreply.github.com; 主题: Re: [CriseLYJ/awesome-python-login-model] 求解惑 (#52) 请问大佬 appid怎么取到的? 怎么知道访问这个地址需要传入那些参数呢? 我看了一下 是没有给分析过程,所以可能不太清楚参数。你需要分析过程吗?昨天在写提取教程,没来得及回复。 — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread. 你看一下有没有解决你的问题呢? https://github.com/Dustyposa/goSpider/tree/master/spider_project/login/wx_web

shenxianxgg commented 5 years ago

如果可以的话 最好给一份 ------------------ 原始邮件 ------------------ 发件人: "Dustyposa"notifications@github.com; 发送时间: 2019年4月15日(星期一) 中午1:26 收件人: "CriseLYJ/awesome-python-login-model"awesome-python-login-model@noreply.github.com; 抄送: "upperone"1114181244@qq.com; "Author"author@noreply.github.com; 主题: Re: [CriseLYJ/awesome-python-login-model] 求解惑 (#52) 请问大佬 appid怎么取到的? 怎么知道访问这个地址需要传入那些参数呢? 我看了一下 是没有给分析过程,所以可能不太清楚参数。你需要分析过程吗?昨天在写提取教程,没来得及回复。 — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread. 你看一下有没有解决你的问题呢? https://github.com/Dustyposa/goSpider/tree/master/spider_project/login/wx_web

问题已解决,非常感谢,这个开发思路对我这种半吊子水平的初学者来说非常宝贵,就像前方的一盏明灯,再次谢谢

Dustyposa commented 5 years ago

@shenxianxgg Ok 能解决你的问题你ok