私はSeleniumでヘッドレスFirefoxを実行しようとしています。以下の私のコードは次のとおりです。firefoxヘッドレスの問題を実行する
selenium.webdriver.firefox.options import Options
from selenium import webdriver
from selenium.webdriver.firefox.options import Options
options = Options()
options.add_argument('--headless')
options.add_argument('--hide-scrollbars')
options.add_argument('--disable-gpu')
driver = webdriver.firefox(firefox_options = options)
driver.get('https://wtfismyip.com')
print(driver.find_element_by_tag_name('body').text)
それは私を与え続けて:
driver = webdriver.firefox(firefox_options = options)
TypeError: 'module' object is not callable
私はクロームでは問題がなかったしています。
同じ問題が続く:| | –
彼は言ったFirefoxの資本金 –
@ ShubhamJainそれは働いた。大好き!それは20%多くのCPUを使用します!それはヘッドレスを使用しないためにCPUを少なくしています。 Chromeが10%を保存しました –