Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/347.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/90.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
隐藏元素不是';t在响应中发送-python请求/beautifulsoup_Python_Html_Beautifulsoup_Python Requests - Fatal编程技术网

隐藏元素不是';t在响应中发送-python请求/beautifulsoup

隐藏元素不是';t在响应中发送-python请求/beautifulsoup,python,html,beautifulsoup,python-requests,Python,Html,Beautifulsoup,Python Requests,在Hotmail登录页面,如果您希望看到HTML代码,您可以看到有一些隐藏字段。如果查看源代码,隐藏字段就不存在了 问题是我需要隐藏字段的值。当我从侧面请求HTML时,如下图所示: with requests.session() as c: headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Saf

在Hotmail登录页面,如果您希望看到HTML代码,您可以看到有一些隐藏字段。如果查看源代码,隐藏字段就不存在了

问题是我需要隐藏字段的值。当我从侧面请求HTML时,如下图所示:

with requests.session() as c:
    headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36'}
    url = 'https://login.live.com/login.srf?wa=wsignin1.0&rpsnv=13&ct=1482763638&rver=6.4.6456.0&wp=MBI_SSL&wreply=https%3a%2f%2foutlook.live.com%2fowa%2f&lc=1030&id=292841&mkt=da-dk&cbcxt=out&fl=wld'
    req = requests.post(url, data=payload, headers=headers)
    html = req.text
    soup = BeautifulSoup(html, 'html.parser')
它采用源代码的HTML。。这是个问题。因为现在我没有得到隐藏的字段

我该怎么办

链接到hotmail登录(供您检查HTML):

编辑:源代码中有一个隐藏字段,但是为什么源代码中的所有隐藏字段都不是来自“expect元素”呢


这里是隐藏在源代码中没有出现的字段:

您认为哪些元素是代码>隐藏< /代码>?您的意思是
iframe
?这是源代码,您可以看到只有一个“隐藏”字段。。?您可以使用
Selenium
获取包含动态生成内容的页面源代码。您对
Python
+
Selenium
上的代码感兴趣吗?AFAIK
请求
不可能等到第页上执行
JavaScript