Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR HTML

list links in a website python html

import requests
from bs4 import BeautifulSoup
 
 
url = 'https://www.geeksforgeeks.org/'
reqs = requests.get(url)
soup = BeautifulSoup(reqs.text, 'html.parser')
 
urls = []
for link in soup.find_all('a'):
    print(link.get('href'))
Source by www.geeksforgeeks.org #
 
PREVIOUS NEXT
Tagged: #list #links #website #python #html
ADD COMMENT
Topic
Name
7+1 =