pip install selenium
sudo emacs /etc/yum.repos.d/google.chrome.repo [google-chrome] name=google-chrome baseurl=http://dl.google.com/linux/chrome/rpm/stable/$basearch enabled=1 gpgcheck=1 gpgkey=https://dl-ssl.google.com/linux/linux_signing_key.pub sudo yum update sudo yum -y install google-chrome-stable google-chrome --version Google Chrome 83.0.4103.97
orDownloads - ChromeDriver - WebDriver for Chrome https://sites.google.com/a/chromium.org/chromedriver/downloads (ChromeDriver 83.0.4103.39 for Chrome version 83) unzip chromedriver_linux64.zip sudo mv chromedriver /usr/local/bin/ sudo chown root:root /usr/local/bin/chromedriver
pip install chromedriver-binary==83.0.4103.39 (import chromedriver_binary)
from selenium import webdriver
options = webdriver.ChromeOptions()
options.add_argument('--headless')
options.add_argument('--disable-gpu')
driver = webdriver.Chrome(options=options)
driver.get('https://yapi.ta2o.net/')
print(driver.page_source)
w = driver.execute_script('return document.body.scrollWidth')
h = driver.execute_script('return document.body.scrollHeight')
driver.set_window_size(w, h)
driver.save_screenshot('screenshot.png')
driver.quit()
<html lang="ja"><head> <meta charset="UTF-8"> <title>キンセリ(Kindleセール情報まとめリストを1時間ごとに更新)</title> <meta property="og:title" content="キンセリ"> ...![]()