Skip to content

Commit 8bed226

Browse files
author
sherpahu
authored
add java solution
1 parent f2b96b5 commit 8bed226

File tree

7 files changed

+40528
-2
lines changed

7 files changed

+40528
-2
lines changed

img/leetcode_big.png

62.7 KB
Loading

img/leetcode_small.png

5.87 KB
Loading

leetcode题解助手.user.js

Lines changed: 17 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

爬虫/getId2UrlInCnblog.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
from bs4 import BeautifulSoup
2+
import requests
3+
f=open('output.txt','w+',encoding='gbk')
4+
text=open('text.txt','r+',encoding='gbk')
5+
soup=BeautifulSoup(text.read(),'lxml')
6+
all_tr=soup.find('div',class_='postBody').find_all('tr')
7+
for tr in soup.find('div',class_='postBody').find_all('tr'):
8+
try:
9+
id_=tr.find('td')
10+
url=tr.find('a')['href']
11+
#print(id_.get_text())
12+
print("\""+id_.get_text()+"\" :"+"\""+url+"\", ",end="",file=f)
13+
except:
14+
pass
15+

爬虫/leetcode_rst.txt

Lines changed: 13 additions & 0 deletions
Large diffs are not rendered by default.

爬虫/output.txt

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

爬虫/text.txt

Lines changed: 40482 additions & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)