Fix browser agent
This commit is contained in:
3
main.py
3
main.py
@ -3,7 +3,6 @@ from bs4 import BeautifulSoup
|
|||||||
from urllib.parse import urlparse, urlunparse
|
from urllib.parse import urlparse, urlunparse
|
||||||
import pandas as pd
|
import pandas as pd
|
||||||
|
|
||||||
headers = {'User-Agent': 'myprogram/1.0'}
|
|
||||||
def scrape_headings(url):
|
def scrape_headings(url):
|
||||||
try:
|
try:
|
||||||
# Check if the URL has a scheme (http/https), and add one if missing
|
# Check if the URL has a scheme (http/https), and add one if missing
|
||||||
@ -42,7 +41,7 @@ def scrape_headings(url):
|
|||||||
|
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
url = input("Enter the URL: ")
|
url = input("Enter the URL: ")ls
|
||||||
scrape_headings(url)
|
scrape_headings(url)
|
||||||
# df = pd.DataFrame(scrape_headings(url))
|
# df = pd.DataFrame(scrape_headings(url))
|
||||||
search_again = input("Do you want to search again? y/n:").lower()
|
search_again = input("Do you want to search again? y/n:").lower()
|
||||||
|
|||||||
Reference in New Issue
Block a user