Power Shell执行IndexError:从空列表弹出

时间:2019-05-09 23:58:22

标签: python-3.x web-scraping

执行文件时出现问题,可视化错误IndexError:从空列表中弹出,但我无法解决问题,它支持UTF-8

PS E:\Cursos\LinkedIn> python linkedin_learning.py
2019-05-09 10:49:28,377 asyncio      DEBUG    Using selector: SelectSelector
2019-05-09 10:49:28,386 root         INFO     [*] -------------Login-------------
2019-05-09 10:49:28,387 root         INFO     [*] Login step 1 - Getting CSRF token...
Traceback (most recent call last):
  File "linkedin_learning.py", line 227, in <module>
    loop.run_until_complete(process())
  File "C:\Users\Josip\AppData\Local\Programs\Python\Python36\lib\asyncio\base_events.py", line 484, in run_until_complete
    return future.result()
  File "linkedin_learning.py", line 211, in process
    await login(USERNAME, PASSWORD)
  File "linkedin_learning.py", line 83, in login
    csrf = html.xpath("//input[@id='loginCsrfParam-login']/@value").pop()
IndexError: pop from empty list

0 个答案:

没有答案