17、设置Phantom JS的请求useragent

dcap = dict(DesiredCapabilities.PHANTOMJS)
dcap["phantomjs.page.settings.userAgent"] = (
    "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.103 Safari/537.36" )

browser = webdriver.PhantomJS(desired_capabilities=dcap)
posted @ 2021-01-06 20:09  hefany  阅读(127)  评论(0编辑  收藏  举报