Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/300.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中读取网络选项卡?_Python_Networking_Web Scraping_Firefox Developer Tools - Fatal编程技术网

如何在Python中读取网络选项卡?

如何在Python中读取网络选项卡?,python,networking,web-scraping,firefox-developer-tools,Python,Networking,Web Scraping,Firefox Developer Tools,使用Selenium、Requests和Beauty Soup,我希望能够找到并打印此.m3u8链接(或此处显示的任何链接),但我不知道如何在Python中显示请求 必须使用ChromeDriver、Pycrome和DevTools协议,但这是有效的: def outputstart(**kwargs): print("START ", kwargs) driver = sp.driver # my chromedriver profile with an arg

使用Selenium、Requests和Beauty Soup,我希望能够找到并打印此.m3u8链接(或此处显示的任何链接),但我不知道如何在Python中显示请求


必须使用ChromeDriver、Pycrome和DevTools协议,但这是有效的:

def outputstart(**kwargs):
    print("START ", kwargs)

driver = sp.driver # my chromedriver profile with an argument added for port 8000

dev_tools = pychrome.Browser(url="http://localhost:8000")
tab = dev_tools.list_tab()[0]
tab.start()

url = 'https://google.com'

start = time.time()
driver.get(url)
tab.call_method("Network.emulateNetworkConditions",
            offline=False,
            latency=100,
            downloadThroughput=93750,
            uploadThroughput=31250,
            connectionType="wifi")

def outputstart(**kwargs):
    print("START ", kwargs)

tab.call_method("Network.enable", _timeout=20)
tab.set_listener("Network.requestWillBeSent", outputstart)
def outputstart(**kwargs):
    print("START ", kwargs)

driver = sp.driver # my chromedriver profile with an argument added for port 8000

dev_tools = pychrome.Browser(url="http://localhost:8000")
tab = dev_tools.list_tab()[0]
tab.start()

url = 'https://google.com'

start = time.time()
driver.get(url)
tab.call_method("Network.emulateNetworkConditions",
            offline=False,
            latency=100,
            downloadThroughput=93750,
            uploadThroughput=31250,
            connectionType="wifi")

def outputstart(**kwargs):
    print("START ", kwargs)

tab.call_method("Network.enable", _timeout=20)
tab.set_listener("Network.requestWillBeSent", outputstart)