Skip to content

Instantly share code, notes, and snippets.

@max-torch
Last active May 27, 2021 08:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save max-torch/36c30c55ba177394eda1cb1b66354b3f to your computer and use it in GitHub Desktop.
Save max-torch/36c30c55ba177394eda1cb1b66354b3f to your computer and use it in GitHub Desktop.
bssoupblog
import re
wht_date = soup.select(".wht_date")
wht_date = [each.get_text() for each in wht_date[1:]]
wht_items = soup.select(".wht_items")
wht_items = [each.get_text().replace("\n", "_").replace("\t", "") for each in wht_items[1:]]
wht_type = soup.select(".wht_type")
wht_type = [each.get_text().replace("\n", "_").replace("\t", "") for each in wht_type[1:]]
wht_total = soup.select(".wht_total")
wht_total = [float(re.findall(r'\d+.\d+', each.get_text().strip().replace(',', ''))[0]) for each in wht_total[1:]]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment