Skip to content

Instantly share code, notes, and snippets.

@offby1
Created September 11, 2016 03:45
Show Gist options
  • Save offby1/ee0b5dcf7015fe1deb652e7288c12abe to your computer and use it in GitHub Desktop.
Save offby1/ee0b5dcf7015fe1deb652e7288c12abe to your computer and use it in GitHub Desktop.
import urllib.parse
for link in soup.find_all('a', href=re.compile('.*index.php\\?topic=')):
parsed = urllib.parse(link)
if not parsed.fragment:
print(link.get('href'), link.text)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment