Created
August 25, 2021 11:29
-
-
Save russelllim22/2f1802a4680f1ef6541eab4616354703 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
for a in sect.find_all('a'): | |
# i'm looking for an <a> tag in the <section> that starts with the string " in" | |
if (len(a.text) > 4 and a.text[0].isspace() and a.text[1:3] == "in"): | |
# The publication name is inside the <a> tag following the substring " in" | |
pub_name = a.text[4:] | |
if pub_name in pubs: | |
pub_count[pubs.index(pub_name)] += 1 | |
else: | |
pubs.append(pub_name) | |
pub_count.append(1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment