株式会社ヴァンデミックシステム

Blog

<スポンサーリンク>

OSに合わせたドライバーをインストール
https://sites.google.com/a/chromium.org/chromedriver/downloads

from selenium import webdriver
from selenium.webdriver.common.keys import Keys

chrome = webdriver.Chrome("./driver/chromedriver.exe")


# 検索ワード
word = "powershell"

# 技術ページを開く
chrome.get("https://vamdemicsystem.black/blog-and-news")

# 検索ボックスを指定
search_box = chrome.find_element_by_name("s")
search_box.send_keys(word)
search_box.submit()

search_result = chrome.find_element_by_id("post-box-content").text
print(search_result)

動作結果

<スポンサーリンク>

コメントを残す

Allowed tags:  you may use these HTML tags and attributes: <a href="">, <strong>, <em>, <h1>, <h2>, <h3>
Please note:  all comments go through moderation.

*

日本語が含まれない投稿は無視されますのでご注意ください。(スパム対策)