We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c8ddcef commit 0fd7a30Copy full SHA for 0fd7a30
Scripts/crawler/leetcode.py
@@ -0,0 +1,15 @@
1
+from selenium import webdriver
2
+
3
+browser = webdriver.PhantomJS()
4
+url = 'https://leetcode.com/problems/house-robber/description/'
5
+browser.get(url)
6
+desc = browser.find_elements_by_xpath('//meta[@name="description"]')
7
+browser.find_element_by_xpath("//div[@class='Select-control']").click()
8
+print browser.find_element_by_xpath("//div[@class='Select-control']").text
9
+code_bak = browser.find_elements_by_xpath('//textarea[@name="lc-codemirror"]')
10
+code = browser.find_elements_by_xpath('//pre[@class=" CodeMirror-line "]/span')
11
+for t in desc:
12
+ print t.get_attribute("content")
13
+for c in code:
14
+ print c.text
15
+browser.quit()
0 commit comments