Jump to content

putting a set if (50) URLS into an array


Recommended Posts

Good day and hello dear experts,


want to add a array where i can store URLs that needed to be fetched
 

 


import bs4
from urllib.request im,port urlopen as uReq
from bs4 import BeautifulSoup as soup

my_url = "https://wordpress.org/plugins/participants-database/"
uClient = uReq(my_url)
page_html = uClient.read()
uClient.close()
page_soup = soup(page_html, "html.parser")

ttt = page_soup.find("div", {"class":"plugin-meta"})
text_nodes = [node.text.strip() for node in ttt.ul.findChildren('li')[:-1:2]]
print(text_nodes)
 


 

Output of text_nodes:

'Version: 1.7.7.7', 'Active installations: 10,000+', 'Tested up to: 4.9.4']
so far so good
 
 

Background: want to fetch the following data from this page:

https://wordpress.org/plugins/participants-database/

i need the data of the following three lines - in the above mentioned example
 

 


Version: <strong>1.29.3</strong>
Active installations: <strong>100,000+</strong>
Tested up to: <strong>4.9.4</strong>

again: want to add a array where i can store URLs that needed to be fetched

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.