Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how list ul info with python

# importing the modules
import requests
from bs4 import BeautifulSoup
  
# providing url
url = 'https://auth.geeksforgeeks.org/user/adityaprasad1308/articles'
  
# creating request object
req = requests.get(url)
  
# creating soup object
data = BeautifulSoup(req.text, 'html')
  
# finding all li tags in ul and printing the text within it
data1 = data.find('ul')
for li in data1.find_all("li"):
    print(li.text, end=" ")
Source by www.geeksforgeeks.org #
 
PREVIOUS NEXT
Tagged: #list #ul #info #python
ADD COMMENT
Topic
Name
8+1 =