Last active
July 24, 2022 03:45
-
-
Save GitHub30/607e2e71774a434bff5b234eb3610112 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mkdir -p ~/job-draft | |
cd ~/job-draft | |
max_page=64 | |
mkdir -p open | |
for i in `seq $max_page`; do wget "https://job-draft.jp/users/search/career/open?page=$i&user_search%5Bopen_career%5D=1" -O open/$i.html; done | |
sudo apt install -y python3-lxml |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from glob import glob | |
from lxml.html import parse | |
from lxml import etree | |
[parse(file) for file in glob('open/*.html')] | |
print('\n'.join(sum([[str(etree.tostring(root)) for root in parse(file).xpath('//div[@class="p-users-listview__item"]')] for file in glob('open/*.html')], []))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment