Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

list index out of range #1

Open
KanwarHaseebAhmad opened this issue Dec 8, 2022 · 1 comment
Open

list index out of range #1

KanwarHaseebAhmad opened this issue Dec 8, 2022 · 1 comment

Comments

@KanwarHaseebAhmad
Copy link

when i run your jupytor notebook's code it give this error on 4th table

/tmp/ipykernel_29774/2924215273.py:2: DeprecationWarning: executable_path has been deprecated, please pass in a Service object
  browser = webdriver.Chrome(path)
---------------------------------------------------------------------------
IndexError                                Traceback (most recent call last)
Cell In [11], line 4
      2 browser = webdriver.Chrome(path)
      3 login(browser)
----> 4 connections = connections_scraper(browser)
      5 browser.quit()
      6 connections.to_csv('connections.csv')

Cell In [10], line 6, in connections_scraper(browser)
      4 soup = BeautifulSoup(browser.page_source, 'html.parser')
      5 conn_num = soup.find_all('h3', class_='search-results__total')
----> 6 num = int(conn_num[0].text.strip().split()[0])
      7 time.sleep(3)
      8 i = 2

IndexError: list index out of range

Please Solve this issue if you are free. this would be very helpful

@tanzeelgcuf
Copy link

IndexError
The IndexError is raised when you attempt to retrieve an index from a sequence, like a list or a tuple, and the index isn’t found in the sequence. The Python documentation defines when this exception is raised:

Raised when a sequence subscript is out of range. ([Source)]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants