Skip to content

Instantly share code, notes, and snippets.

@skittleson
Created September 29, 2023 05:23
Show Gist options
  • Save skittleson/498ff5e355c63e917e7937e245a9bd5b to your computer and use it in GitHub Desktop.
Save skittleson/498ff5e355c63e917e7937e245a9bd5b to your computer and use it in GitHub Desktop.
Who Is Hiring
from bs4 import BeautifulSoup
import requests
import re
if __name__ == '__main__':
html = requests.get(r'https://news.ycombinator.com/item?id=37351667&p=1')
soup = BeautifulSoup(html.text,'html.parser')
all_spans = soup.find_all('span', class_='commtext')
for span in all_spans:
comment_content = span.text.strip()
matches = re.findall(r'data analyst', comment_content, re.IGNORECASE)
if len(matches) > 0:
print(comment_content)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment