Selenium: How to Inject/execute a Javascript in to a Page before loading/executing any other scripts of the page?

后端 未结 4 1276
花落未央
花落未央 2020-12-05 10:12

I\'m using selenium python webdriver in order to browse some pages. I want to inject a javascript code in to a pages before any other Javascript codes get loaded and execut

4条回答
  •  孤街浪徒
    2020-12-05 11:01

    If you want to inject something into the html of a page before it gets parsed and executed by the browser I would suggest that you use a proxy such as Mitmproxy.

提交回复
热议问题