티스토리 뷰
728x90
pip install lxml html5lib beautifulsoup4
import pandas as pd
url = 'https://en.wikipedia.org/wiki/History_of_Python'
dfs = pd.read_html(url)
print(len(dfs))
print(dfs[0]['Version'])
print(dfs[0]['Release date'])
# Load pandas
import pandas as pd
# Webpage url
url = 'https://en.wikipedia.org/wiki/History_of_Python'
# Extract tables
dfs = pd.read_html(url)
# Get first table
df = dfs[0]
# Extract columns
df2 = df[['Version','Release date']]
print(df2)
# Write to excel
df2.to_excel('python.xlsx')
https://pythonbasics.org/pandas-web-scraping/
Pandas Web Scraping - Python Tutorial
Pandas makes it easy to scrape a table ( tag) on a web page. After obtaining it as a DataFrame, it is of course possible to do various processing and save it as an Excel file or csv file. In this article you’ll learn how to extract a table from any webpa
pythonbasics.org
728x90
'공부' 카테고리의 다른 글
| [kotlin] public static void main (0) | 2022.08.18 |
|---|---|
| [gradle] jar > archive contains more than 65535 entries. (0) | 2022.08.17 |
| [Scala] SparkSession.conf(String, Any) (0) | 2022.08.13 |
| [kotlin] map -> flatMap (0) | 2022.08.11 |
| Spring Webflux + JDBC(혹은 blocking call) 핸들링 방법 (0) | 2022.08.11 |
댓글
250x250
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
TAG
- 테슬라 리퍼럴 코드
- 어떻게 능력을 보여줄 것인가?
- 레퍼럴
- 클루지
- 개리마커스
- 연애학개론
- 모델y
- 테슬라
- 테슬라 크레딧 사용
- 테슬라 레퍼럴 코드 확인
- follower
- 테슬라 리퍼럴 코드 생성
- 팔로워 수 세기
- 모델 Y 레퍼럴
- 메디파크 내과 전문의 의학박사 김영수
- 테슬라 레퍼럴
- 인스타그램
- 테슬라 레퍼럴 적용 확인
- 책그림
- 테슬라 추천
- Bot
- 테슬라 리퍼럴 코드 혜택
- wlw
- 할인
- 김달
- Kluge
- 유투브
- COUNT
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | |||
| 5 | 6 | 7 | 8 | 9 | 10 | 11 |
| 12 | 13 | 14 | 15 | 16 | 17 | 18 |
| 19 | 20 | 21 | 22 | 23 | 24 | 25 |
| 26 | 27 | 28 | 29 | 30 | 31 |
글 보관함