2021年1月6日星期三

how can use python get this url(from wechat)?

    import time      from selenium import webdriver      from selenium.webdriver.chrome.options import Options      chrome_options = Options()      chrome_options.add_argument('--headless')      driver = webdriver.Chrome(chrome_options=chrome_options)            testUrl ='http://mp.weixin.qq.com/s?__biz=MzA4ODIxNjY1OA==&mid=2650747988&idx=1&sn=de85a17895c5e28eb9e4142cdeccbdaf&chksm=88261169bf51987f66f41f5a2dc850af2e30ae77f01c82c45eb4ecd619714daa970b6120c834&scene=27#wechat_redirect'                  geturl = driver.get(testUrl)      time.sleep(4)             html = driver.execute_script("return document.documentElement.outerHTML")      with open('selenium.txt', 'w', encoding='utf-8') as f:            f.write(html)        driver.close()    

now, this URL can be view in chrome or safari correctly, but the content what I get in the above code is different, it asks/prompt me to provide the cookie so the page can be load, how can I do it?

https://stackoverflow.com/questions/65606060/how-can-use-python-get-this-url-from-wechat January 07, 2021 at 10:58AM

没有评论:

发表评论