Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help copying data from a website
#2
The whole table is generated bye JavaScript,so the way you do it now will not work.
Also should look if site has an API to get date more easy.

Can use Selenium ,here a working setup.
Also when use this so most this path Service(r"C:\cmder\bin\chromedriver.exe") be in OS environment Path.
If not sure of Path just put chromedriver.exe in windows folder Service(r"C:\Windows\chromedriver.exe").
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.chrome.service import Service
from selenium.webdriver.common.by import By
import time

# Setup
# Cromedriver most use version that your browser use
#https://edgedl.me.gvt1.com/edgedl/chrome/chrome-for-testing/118.0.5939.0/win64/chromedriver-win64.zip
options = Options()
#options.add_argument("--headless=new")
ser = Service(r"C:\cmder\bin\chromedriver.exe")
browser = webdriver.Chrome(service=ser, options=options)
# Parse or automation
url = 'https://sc2pulse.nephest.com/sc2/?season=56&queue=LOTV_1V1&team-type=ARRANGED&us=true&eu=true&kr=true&cn=true&bro=true&sil=true&gol=true&pla=true&dia=true&mas=true&gra=true&page=0&type=ladder&ratingAnchor=99999&idAnchor=0&count=1#ladder-top'
browser.get(url)
time.sleep(2)
first_row = browser.find_element(By.CSS_SELECTOR, '#ladder > tbody > tr:nth-child(7)')
print(first_row.text)
Output:
1 7239 BasiliskSerralllllllllllllrevealed 31 87
Reply


Messages In This Thread
Help copying data from a website - by awere34a4e3 - Nov-07-2023, 02:59 AM
RE: Help copying data from a website - by snippsat - Nov-07-2023, 02:35 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Scraping lender data from Ren Ren Dai website using Python. I will pay for that 200$ Hafedh_2021 1 2,818 May-18-2021, 08:41 PM
Last Post: snippsat
  How to get registeration data from a website that uses .aspx? Help me brothers. humble_coder 1 2,532 Feb-18-2021, 06:03 PM
Last Post: Larz60+
  Exporting excel data to website bdarragh00 1 2,675 Jun-15-2018, 08:57 PM
Last Post: micseydel
  Selenium to pick data from csv and enter into website Prince_Bhatia 1 6,443 Sep-08-2017, 10:58 AM
Last Post: hbknjr

Forum Jump:

User Panel Messages

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