Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/297.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
Python 如何从.aspx页面提取所有源代码?_Python_Web Scraping - Fatal编程技术网

Python 如何从.aspx页面提取所有源代码?

Python 如何从.aspx页面提取所有源代码?,python,web-scraping,Python,Web Scraping,我正在尝试提取以下代码的源代码: . 以下是我的python代码: from selenium import webdriver browser = webdriver.Chrome() browser.get(url) # url=http://www.tsetmc.com/Loader.aspx?ParTree=15131F html = browser.page_source print(html) 我甚至尝试了以下代码: import requests

我正在尝试提取以下代码的源代码: .
以下是我的python代码:

from selenium import webdriver
browser = webdriver.Chrome()
browser.get(url)                 # url=http://www.tsetmc.com/Loader.aspx?ParTree=15131F
html = browser.page_source
print(html)
我甚至尝试了以下代码:

import requests
req = requests.get(url)
print(req.text)
当我试图打印源代码时,它不会返回我期望的结果。

我在浏览器中看到,如何提取整个源代码?

您预期的结果是什么?您目前得到的是什么?