実現したいこと
エラーを改善したいです。
前提
windous10でpycharmを使い、seleniumを用いたgoogle検索を行うプログラムを作成した所以下のようなエラーが出ました。
発生している問題・エラーメッセージ
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='10.0.2.2', port=4444): Max retries exceeded with url: /session (Caused by ConnectTimeoutError(<u rllib3.connection.HTTPConnection object at >, 'Connection to 10.0.2.2 timed out. (connect timeout=None)'))
該当のソースコード
``python
from selenium.webdriver import Chrome, ChromeOptions, Remote
from selenium.webdriver.common.keys import Keys
options = ChromeOptions()
options.headless = True
driver = Remote('http://10.0.2.2:4444', options=options)
driver.get('https://www.google.co.jp')
assert 'Google' in driver.title
input_element = driver.find_element_by_name('q')
input_element.send.keys('Python')
input_element.send_keys(Keys.RETURN)
assert 'Python' in driver.title
driver.save_screenshot('search_results.png')
for h3 in driver.find_elements_by_css_selector('a > h3'):
a = h3.find_element_by_xpath('..')
print(h3.text)
print(a.get_attribute('href'))
### 試したこと webdriverのバージョンの確認などを行いましたが解決できませんでした。 ### 補足情報(FW/ツールのバージョンなど) pycharm で行っています。
