Skip to content

Instantly share code, notes, and snippets.

@hassaku63
Created December 8, 2018 08:30
Show Gist options
  • Save hassaku63/e986a7123ed3dc00034b0435aae08e76 to your computer and use it in GitHub Desktop.
Save hassaku63/e986a7123ed3dc00034b0435aae08e76 to your computer and use it in GitHub Desktop.
#
# Date: 2018-12-08
# Author: hassaku63
#
# These codes are licensed under CC0.
# http://creativecommons.org/publicdomain/zero/1.0/deed.ja
#
# Prerequisite:
# - Selenium webdriver
#
from selenium import webdriver
driver = webdriver.Chrome()
site = "https://developer.nulab-inc.com/ja/docs/backlog/"
driver.get()
driver.find_elements_by_partial_link_text("Backlog API")[1].click()
elms = driver.find_elements_by_xpath("//a[contains(@href,'/ja/docs/backlog/api/2/')]")
api_list = [(elm.text, elm.get_attribute("href")) for elm in elms]
@hassaku63
Copy link
Author

画面表示幅が狭いとサイドバーの表示が消えるので、リストの名前がうまく取得できなくなります。必要に応じて

driver.fullscreen_window()

をコールするなどしてください。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment