Last active
March 17, 2018 09:54
-
-
Save hrdtbs/ee7e276b7a821f6639f1fdfaa170fb6a to your computer and use it in GitHub Desktop.
Pythonでスクレイピングしてみようかなって思ったときに最初に書きそうなやつ
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: utf-8 | |
from selenium import webdriver | |
from bs4 import BeautifulSoup | |
options = webdriver.ChromeOptions() | |
options.set_headless() | |
driver = webdriver.Chrome(chrome_options=options) | |
driver.get('https://www.google.co.jp/') | |
driver.save_screenshot("ss.png") | |
html = driver.page_source | |
driver.quit() | |
soup = BeautifulSoup(html, 'html.parser') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment