r.text[ ],括號中的內容用意是什麼?
2020/06/21 10:51 下午
Python網路爬蟲討論版
妹妹陳
觀看數:7
回答數:1
收藏數:0
pycrawler
pycrawler-d08
想請問老師 範例解答中的In [5]:,這一段的r.text[0:3000],加[0:3000]是有什麼用意呢?
url = 'https://www.dcard.tw/f'
r = requests.get(url)
r.encoding = 'utf-8'
print(r.text[0:3000])