Drkcore

24 09 2013 Python Selenium Tweet

seleniumのphantomjsでuser-agent を変更する

googleにchromeとして認識して欲しかったので調べた。

dcap = dict(DesiredCapabilities.PHANTOMJS)
    dcap["phantomjs.page.settings.userAgent"] = (
        "Mozilla/5.0 (Windows NT 5.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/29.0.1547.66 Safari/537.36"
    )
driver = webdriver.PhantomJS(desired_capabilities=dcap)

XPathの書き方も慣れてきた☆

About

  • もう5年目(wishlistありマス♡)
  • 最近はPythonとDeepLearning
  • 日本酒自粛中
  • ドラムンベースからミニマルまで
  • ポケモンGOゆるめ

Tag

Python Deep Learning javascript chemoinformatics Emacs sake and more...

Ad

© kzfm 2003-2021