Skip to content

Commit ccd830e

Browse files
committed
add parse source url python script
1 parent 4a5fd88 commit ccd830e

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

scripts/parse_source.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/usr/bin/env python
2+
3+
from pyquery import PyQuery as pq
4+
5+
def get_lc_src_tags(lc_page):
6+
raw_tags = lc_page('.btn.btn-xs.btn-primary')
7+
return [tag.text() for tag in raw_tags.items()]
8+
9+
def get_lc_src_title(lc_page):
10+
raw_title = lc_page('title').text().split('|')[0][:-1]
11+
12+
def get_lc_difficulty(lc_title):
13+
search_url = "https://leetcode.com/problemset/algorithms/"
14+
15+
def get_source_page(source_url):
16+
return pq(url=source_url)

0 commit comments

Comments
 (0)