Python Forum
How to capture Single Column from Web Html Table?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to capture Single Column from Web Html Table?
#2
Is having table as pandas dataframe is ok?

>>> df = pd.read_html('http://stats.espncricinfo.com/ci/engine/player/348144.htmlclass=3;template=results;type=batting;view=innings')
>>> df[3]
   Runs Mins  BF  ...           Ground   Start Date  Unnamed: 13
0   15*   13  11  ...       Manchester   7 Sep 2016   T20I # 566
1   55*   49  37  ...      Dubai (DSC)  23 Sep 2016   T20I # 568
2    19   28  18  ...      Dubai (DSC)  24 Sep 2016   T20I # 569
3   27*   42  24  ...        Abu Dhabi  27 Sep 2016   T20I # 570
4    29    -  30  ...       Bridgetown  26 Mar 2017   T20I # 602
5    27    -  28  ...    Port of Spain  30 Mar 2017   T20I # 603
6    43    -  38  ...    Port of Spain   1 Apr 2017   T20I # 604
7    38    -  36  ...    Port of Spain   2 Apr 2017   T20I # 605
8    86    -  52  ...           Lahore  12 Sep 2017   T20I # 619
9    45    -  38  ...           Lahore  13 Sep 2017   T20I # 620
10   48    -  31  ...           Lahore  15 Sep 2017   T20I # 621
11    1    -   8  ...        Abu Dhabi  26 Oct 2017   T20I # 625
12    1    -   2  ...        Abu Dhabi  27 Oct 2017   T20I # 627
13  34*    -  31  ...           Lahore  29 Oct 2017   T20I # 629
14   41   68  41  ...       Wellington  22 Jan 2018   T20I # 639
15  50*   45  29  ...         Auckland  25 Jan 2018   T20I # 640
16   18    -  17  ...  Mount Maunganui  28 Jan 2018   T20I # 641
17   17    -  13  ...          Karachi   1 Apr 2018   T20I # 663
18  97*    -  58  ...          Karachi   2 Apr 2018   T20I # 664
19   51    -  40  ...          Karachi   3 Apr 2018   T20I # 665
20  68*    -  55  ...        Abu Dhabi  24 Oct 2018   T20I # 701
21   45    -  44  ...      Dubai (DSC)  26 Oct 2018   T20I # 702
22   50    -  40  ...      Dubai (DSC)  28 Oct 2018   T20I # 704
23    7    -   9  ...        Abu Dhabi  31 Oct 2018   T20I # 705
24   40    -  41  ...      Dubai (DSC)   2 Nov 2018   T20I # 706
25   79   66  58  ...      Dubai (DSC)   4 Nov 2018   T20I # 708
26   38   55  27  ...        Cape Town   1 Feb 2019   T20I # 732
27   90   78  58  ...     Johannesburg   3 Feb 2019   T20I # 734
28   23   10  11  ...        Centurion   6 Feb 2019   T20I # 736
29   65    -  42  ...          Cardiff   5 May 2019   T20I # 772

[30 rows x 14 columns]
I'm not 'in'-sane. Indeed, I am so far 'out' of sane that you appear a tiny blip on the distant coast of sanity. Bucky Katt, Get Fuzzy

Da Bishop: There's a dead bishop on the landing. I don't know who keeps bringing them in here. ....but society is to blame.
Reply


Messages In This Thread
RE: How to capture Single Column from Web Html Table? - by perfringo - Jul-11-2019, 06:50 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Suggestion request for scrapping html table Vkkindia 3 2,041 Dec-06-2021, 06:09 PM
Last Post: Larz60+
  HTML multi select HTML listbox with Flask/Python rfeyer 0 4,649 Mar-14-2021, 12:23 PM
Last Post: rfeyer
  Help: Beautiful Soup - Parsing HTML table ironfelix717 2 2,697 Oct-01-2020, 02:19 PM
Last Post: snippsat
  Python3 + BeautifulSoup4 + lxml (HTML -> CSV) - How to loop to next HTML/new CSV Row BrandonKastning 0 2,371 Mar-22-2020, 06:10 AM
Last Post: BrandonKastning
  Imprt HTML table to array meleghengersor 2 2,122 Jan-23-2020, 10:23 AM
Last Post: perfringo
  BeautifulSoup: Error while extracting a value from an HTML table kawasso 3 3,234 Aug-25-2019, 01:13 AM
Last Post: kawasso
  convert html table to json bhojendra 5 16,034 Jul-30-2019, 07:53 PM
Last Post: DeaD_EyE

Forum Jump:

User Panel Messages

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