Skip to content

Instantly share code, notes, and snippets.

Last active March 2, 2016 10:37
What would you like to do?
# coding: utf-8
from selenium import webdriver
import re, urllib
# Firefox起動
driver = webdriver.Firefox()
while True:
# 標準入力の値を取得
url = raw_input()
# urlをパース
type, opaquestring = urllib.splittype(url)
# urlのスキームをチェック
if type not in ("http", "https"):
# ページ表示
# linkタグを探す
for link in driver.find_elements_by_tag_name("link"):
# linkタグのtypeにrssが含まれているかチェック
if'rss', link.get_attribute("type")) is not None:
# hrefを取得
print link.get_attribute('href')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment