Still Python is a difficult language for me..T_T I really need your help.
I'm trying to crawl some website. The website URL has four digits at the end as shown below.
URL → http://www.boanjob.co.kr/work/employ_detail.html?no=**2196**
So I composed the following code.
import pandas as pd
import datetime
df_list = [pd.read_html(f'http://www.boanjob.co.kr/work/employ_detail.html?no={number}')[25] for number in range(2196, 2300)
df = pd.concat(df_list).reset_index(drop=True)
df = df.transpose() #I have to change rows and columns.
df = df.dropna(axis=0, how='all').dropna(axis=1, how='all')
# df.columns = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H']
print(df)
It works well in 2196, 2198, 2199, 2200 and so on.
However, 2197 is a non-existent page,
so it sends an error message and goes back to the main screen.
(For loop ends in 2197.)
Is there a way to skip work on this page
(the page where the error message occurs) and go to the next number 2198?
I'm so confused about Python.
Plz help me once again...T_T