dil_bert Posted March 6, 2018 Share Posted March 6, 2018 (edited) 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 Edited March 6, 2018 by dil_bert Quote Link to comment Share on other sites More sharing options...
dalecosp Posted March 6, 2018 Share Posted March 6, 2018 s/array/list ... you're talking about Python. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.