0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

問い合フォーム自動入力 / 送信

Posted at

解説

from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.firefox.options import Options
from selenium.webdriver.firefox.service import Service

options = Options()
options.headless = False  # GUIモードで開く(headless=TrueにするとGUIなしで動作)

geckodriver_path = '/usr/local/bin/geckodriver'
service = Service(geckodriver_path)
driver = webdriver.Firefox(service=service, options=options)

driver.get("https://www.nipponcoating.co.jp/recruit_entry/")

# 名前要素 取得 (name属性を使って)
name_element = driver.find_element(By.NAME, "お名前")  # name属性が"名前"のフィールド

# '公開レポート'aタグ取得 
# driver.find_element(By.xpath("//a[@title='公開レポート']"))


# "岸田理沙"を名前フィールドに入力
name_element = driver.find_element(By.NAME, "お名前")
name_element.send_keys("ホゲ丸尾")


# 必要に応じて送信ボタンを押す場合
 submit_button = driver.find_element(By.NAME, "submit") 
 # 送信ボタンのname属性が"submit"の場合
 submit_button.click()


# 操作が完了したらブラウザを閉じる (必要に応じて)
# driver.quit()
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?