Created
November 10, 2014 18:03
-
-
Save satoshihirose/82cbe11da2851de01298 to your computer and use it in GitHub Desktop.
アメブロの画像ダウンローダ
This file contains 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
from selenium import webdriver | |
from selenium.webdriver.common.action_chains import ActionChains | |
from BeautifulSoup import BeautifulSoup as Soup | |
import os | |
import time | |
start_url = 'http://ameblo.jp/gekidanherbest/image-11950650243-13125199892.html' | |
browser = webdriver.Firefox() | |
browser.get(start_url) | |
while True: | |
button = browser.find_element_by_css_selector('#nextNavi') | |
Hover = ActionChains(browser).move_to_element(button) | |
Hover.click(button) | |
Hover.perform() | |
img = browser.find_element_by_css_selector('#imgItem') | |
url = img.get_attribute('src') | |
print url | |
os.system('wget -q ' + url) | |
time.sleep(1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
python+seleniumで書いたameble画像ダウンローダです。
start_urlを対象のブログの最新記事の画像をクリックして表示されるページのURLに書き換えてください。