Skip to content

Commit

Permalink
scrape_docs add headline output to csv format
Browse files Browse the repository at this point in the history
  • Loading branch information
JOJ0 committed Sep 10, 2024
1 parent e58b6aa commit 14bb4d0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions scrape_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ def scrape(output, url):
any_heading_tag = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6']
elements = soup.find_all([*any_heading_tag, 'a'],)

if output == 'csv':
print('Change this headline as required')
print('================================\n')

for e in elements:
if e.name in any_heading_tag and output == 'debug':
print(f'{e.name}: {e.text}')
Expand Down

0 comments on commit 14bb4d0

Please sign in to comment.