How to access table which is in web (using html) and how to get the data of the table using python

0 votes
info : table is not in database or mysql
Oct 29 in Python by nagaveni
• 120 points
133 views

1 answer to this question.

0 votes

Hey. You can use requests and beautifulsoup to extract data from html tables. Refer to this code snippet:

import bs4
import requests

page = requests.get("www.xyz.com")
soup = bs4.BeautifulSoup(page.text)

for tr in soup.find_all('tr'):
    for td in tr.find_all('td'):
        print(td.text)
answered Oct 29 by Shri
i need to access table in web page (table which is html , not in sql  format) and i need to get the data of the table (no need to create table and data which is already there in web via html )
Hello,

I am still unclear on what your exact query is? By "table in html", you the contents inside the <table><tr><td> tags right? Please mention a use-case to help understand it better.

Related Questions In Python

0 votes
1 answer

How to get the size of a string in Python?

If you are talking about the length ...READ MORE

answered Jun 4, 2018 in Python by ariaholic
• 7,340 points
114 views
0 votes
1 answer

Is arr.__len__() the preferred way to get the length of an array in Python?

my_list = [1,2,3,4,5,6,7] len(my_list) # 7 The same works for ...READ MORE

answered Oct 8, 2018 in Python by SDeb
• 13,210 points
82 views
0 votes
1 answer

How to output the rows which are affected using SQLAlchemy in Python?

Hi, good question. This is actually not ...READ MORE

answered Feb 15 in Python by Nymeria
• 3,520 points
241 views
0 votes
1 answer

How to get the multiplication table of any number using list comprehension?

Hey @Neha, you can use something like ...READ MORE

answered Jul 8 in Python by Sakshi
77 views
0 votes
1 answer

Finding WebDriver element with Class Name in java

The better way to handle this element ...READ MORE

answered Apr 10, 2018 in Selenium by nsv999
• 5,110 points
1,133 views
0 votes
1 answer
0 votes
1 answer

Geo-location microphone camera pop up

To Allow or Block the notification, access using Selenium and you have to ...READ MORE

answered May 11, 2018 in Selenium by Samarpit
• 5,150 points
1,239 views
0 votes
1 answer

How to use such xpath to find web elements

It's much simpler to use: #MyDiv123 > div.super or ...READ MORE

answered Jun 14, 2018 in Selenium by Samarpit
• 5,150 points
990 views
0 votes
1 answer

Is there a way to list out in-built variables and functions of Python?

The in-built variables and functions are defined ...READ MORE

answered May 14 in Python by Junaid
50 views