from bs4 import BeautifulSoup import requests product = input() url = "https://www.avito.ru/rossiya?q=" + product request = requests.get(url) bs = BeautifulSoup(request.text, "html.parser") all_links = bs.find_all('a', class_='link-link-MbQDP') for link in all_links: print('https://www.avito.ru' + link['href'])
Запускаю его, ввожу что хочу найти и все, ничего не происходит
PS C:\Users\79817\Desktop\PY\Пробники> & 'C:\Users\79817\AppData\Local\Programs\Python\Python310\python.exe' 'c:\Users\79817\.vscode\extensions\ms-python.python-2022.14.0\pythonFiles\lib\python\debugpy\adapter/../..\debugpy\launcher' '62903' '--' 'c:\Users\79817\Desktop\PY\робники\parcer.py' Traceback (most recent call last): File "C:\Users\79817\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main return _run_code(code, main_globals, None, File "C:\Users\79817\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in _run_code exec(code, run_globals) File "c:\Users\79817\.vscode\extensions\ms-python.python-2022.14.0\pythonFiles\lib\python\debugpy\__main__.py", line 39, in <module> cli.main() File "c:\Users\79817\.vscode\extensions\ms-python.python-2022.14.0\pythonFiles\lib\python\debugpy/..\debugpy\server\cli.py", line 430, in main run() File "c:\Users\79817\.vscode\extensions\ms-python.python-2022.14.0\pythonFiles\lib\python\debugpy/..\debugpy\server\cli.py", line 284, in run_file runpy.run_path(target, run_name="__main__") File "c:\Users\79817\.vscode\extensions\ms-python.python-2022.14.0\pythonFiles\lib\python\debugpy\_vendored\pydevd\_pydevd_bundle\pydevd_runpy.py", line 320, in run_path code, fname = _get_code_from_file(run_name, path_name) File "c:\Users\79817\.vscode\extensions\ms-python.python-2022.14.0\pythonFiles\lib\python\debugpy\_vendored\pydevd\_pydevd_bundle\pydevd_runpy.py", line 289, in _get_code_from_file with io_open_code(decoded_path) as f: FileNotFoundError: [Errno 2] No such file or directory: 'c:\\Users\\79817\\Desktop\\PY\\робники\\parcer.py'