如何将列表刮入列表熊猫

时间:2018-08-09 19:56:47

标签: python list pandas loops web-scraping

我想遍历循环并输出列表列表,但我一直遇到的错误是“列表索引超出范围”或“'列表'对象无法解释为整数”

#BEGIN LOOP SCRAPE
studentIDs=[1,2,3]
for i, val in  enumerate(studentIDs):

    #Begin scraping
    out_data=[pd.read_html(browser.page_source)]
    #Clicking to another student webpage
    browser.find_element_by_xpath('returns to another page that needs to be scraped').click()

1 个答案:

答案 0 :(得分:0)

studentIDs=[1,2,3]
for index in range(len(studentIDs)):
 out_data=out_data+[pd.read_html(browser.page_source)]