4

Collect data from the web page using BeautifulSoup returns None

 2 years ago
source link: https://www.codesd.com/item/collect-data-from-the-web-page-using-beautifulsoup-returns-none.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Collect data from the web page using BeautifulSoup returns None

advertisements

I'm new at this.. For example, I'm trying to scrape something like this (number 24)

<td class="score part"> <span class="p1_home>24</span></td>

but my code:

from bs4 import BeautifulSoup
import requests

html = requests.get("http://www.rezultati.com/utakmica/jLRSI3m9/#detalji")

soup = BeautifulSoup(html.text,'html.parser')

data2 = soup.find('td',{'class':'score part'})

print(data2)

gives me none

Where was I wrong?


I solved the problem, thank you for your help

from selenium import webdriver
driver = webdriver.Chrome()

driver.get("http://www.rezultati.com/utakmica/jLRSI3m9/#detalji")

posts = driver.find_elements_by_class_name("p1_home")
for post in posts:
    print(post.text)

Related Articles

Extract the data from the html page using Beautifulsoup

<div class="name">    <strong> <a target="_blank" href="/page3.html"> SOME_Name_TEXT </a> </strong> </div> <div class="data"> <img src="/page1/page2/Images/pic.png&q

Python: How to read data from the web page and then write from the database?

I am a beginner. I want to read two inputs (probably from a slide down menu) from a web page and use them as variables to execute python program, then return the result to a database and also display it on the webpage. I`m using mySQL for database ma

Collect data from a web page that is NOT properly trained

I'm trying to scrap the data from the web page. The web page can be any page. For instance I am scraping http://www.google.com/ using curl. It gives so many warnings and do nothing. Warning is on line 30: Warning: SimpleXMLElement::__construct(): in

Trying to extract data from a web page using HtmlAgilityPack

I'm trying to extract a single data from http://www.dsebd.org/displayCompany.php?name=NBL I showed the required field in attached picture for which Xpath: /html/body/table[2]/tbody/tr/td[2]/table/tbody/tr[3]/td1/p1/table1/tbody/tr/td1/table/tbody/tr[

Disable copying data from the web page

I was looking for any way to create web page,so that user wont be able to copy content from my web page. i.e. User wont be able to select the any text present on the webpage. Let's assume i am working on asp.net Any interesting ideas to accomplish th

Collect data from the Web site to Excel

I navigate to a site using vba and get to where I need to be using a form. I need the vba to grab some data from the HTML and put it into an excel sheet. How can I scrap this data into excel? Here is a piece from the page: <div id="ctl00_ContentPl

Get data from the external page using servlets

I'm doing my first college HTML project wich I need to get data from an external Webpage using servlets. First, on the website, I need to enter a key code and fill one captcha to get to the page I need. I'm leaving the captcha to the user, planning t

Jquery Recover data from the web page and enter it in the database

I am new to Jquery. I want to read specific data(some div's only) from a webpage and store it in my database. Now I am not able to do so as load functions loads the data into the current page id. My goal is to read specific data and store them in dat

Extracting data from a web page using java

I'm working on a project that consists on collecting job offers from the web. So as a first step, I want to extract data (job offer data) from a specific webpage. So I want to know if there is an API or an existing code that can help me.The best proj

Obtain data from the sample page using the jQuery AJAX method

I am given a sample page to obtain a string from it. The I am to convert this sting to a variable that can be used for a different code. I been trying for hours to get the data from the page but I am at a lost. First I created a sample code to read t

How do I get data from the web page?

I want to get the data from this page and insert it to my mssql database. How can I read this data with asp.net c#? SehisID is a value from 1 to 81. EDIT: My code is below. for (int i = 1; i <= 81; i++) { HttpWebRequest rqst = (HttpWebRequest)WebRequ

How to get data from the html page using java?

How to get data from XML/HTML page? I'd like to make an android app, in which users get a notification of a school-lesson that fell out. This is what the website looks like: http://www.anony.ws/image/pC9 Users fill in their school class (klas) after

Unable to parse data from a web page using curl

I am using curl to extract some data of a website.First time it works perfectly , but now it not parse any data from the website.I think they are blocked my server ip.So I can use public proxy ip.But still it not working.My code is , $ch = curl_init(

Transferring Data from the Web Page to an Excel Worksheet Using VBA

This is my first post. I am new at VBA but I'm pretty familiar with VB6. I wrote some code that takes the text from nasdaq and pastes it into a worksheet. It finally works. There is a lot of extraneous data scattered around above and below The Annual

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK