Python Forum
How to read html tags dynamically generated?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to read html tags dynamically generated?
#3
In the following code I'm trying to get the number 1151 from the span tag inside the span tag <span class="kno-fb-ctx _i2g">

The problem is the code isn't finding anything!

from bs4 import BeautifulSoup
import requests

url = "https://www.google.com.br/search?q=timemania"
source_code = requests.get(url)
plaint_text = source_code.text
soup = BeautifulSoup(plaint_text, 'html.parser')
div_balls = soup.findAll('span', {'class':'kno-fb-ctx _i2g'})

print(len(div_balls))
]]

The output is 0. Should be 1 i think.
Reply


Messages In This Thread
RE: How to read html tags dynamically generated? - by amandacstr - Mar-04-2018, 08:46 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
Question Python Obstacles | Jeet-Kune-Do | BS4 (Tags > MariaDB) [URL/Local HTML] BrandonKastning 0 1,438 Feb-08-2022, 08:55 PM
Last Post: BrandonKastning
  HTML multi select HTML listbox with Flask/Python rfeyer 0 4,708 Mar-14-2021, 12:23 PM
Last Post: rfeyer
  Any way to remove HTML tags from scraped data? (I want text only) SeBz2020uk 1 3,519 Nov-02-2020, 08:12 PM
Last Post: Larz60+
  Open and read a tab delimited file from html using python cgi luffy 2 2,713 Aug-24-2020, 06:25 AM
Last Post: luffy
  Easy HTML Parser: Validating trs by attributes several tags deep? runswithascript 7 3,646 Aug-14-2020, 10:58 PM
Last Post: runswithascript
  Jinja2 HTML <a> tags not rendering properly ChaitanyaPy 4 3,296 Jun-28-2020, 06:12 PM
Last Post: ChaitanyaPy
  Python3 + BeautifulSoup4 + lxml (HTML -> CSV) - How to loop to next HTML/new CSV Row BrandonKastning 0 2,403 Mar-22-2020, 06:10 AM
Last Post: BrandonKastning
  How do I get rid of the HTML tags in my output? glittergirl 1 3,769 Aug-05-2019, 08:30 PM
Last Post: snippsat
  Beutifulsoup: how to pick text that's not in HTML tags? pitonas 4 4,775 Oct-08-2018, 01:43 PM
Last Post: pitonas
  read text file using python and display its output to html using django amit 0 18,350 Jul-23-2017, 06:14 AM
Last Post: amit

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020