<?xml version="1.0" encoding="utf-8"?>

<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
	<channel>
		<title>Python для начинающих - Форум программистов и сисадминов Киберфорум</title>
		<link>https://www.cyberforum.ru/</link>
		<description>Форум программистов Python. Обсуждение основ языка программирования Python. Помощь в решении задач, готовые решения и ответы на вопросы.</description>
		<language>ru</language>
		<lastBuildDate>Thu, 07 May 2026 02:23:37 GMT</lastBuildDate>
		<generator>vBulletin</generator>
		<ttl>60</ttl>
		<image>
			<url>https://www.cyberforum.ru//cyberstatic.net/images/misc/rss.jpg</url>
			<title>Python для начинающих - Форум программистов и сисадминов Киберфорум</title>
			<link>https://www.cyberforum.ru/</link>
		</image>
		<item>
			<title>Ошибка KeyboardInterrupt при работе с patchright - Python для начинающих</title>
			<link>https://www.cyberforum.ru/python-beginners/thread3222765.html</link>
			<pubDate>Sun, 03 May 2026 10:05:07 GMT</pubDate>
			<description>Проблема с ошибкой KeyboardInterrupt при работе с Patchright возникает при каждом запуске скрипта в...</description>
			<content:encoded><![CDATA[<div>Проблема с ошибкой KeyboardInterrupt при работе с Patchright возникает при каждом запуске скрипта в новом терминале. При втором запуске, после получения ошибки, всё работает как должно<br />
<br />
<div class="printablecode">
	<div class="smallfont">:</div>
	<hr /><code dir="ltr">import asyncio<br />
import time<br />
from patchright.async_api import async_playwright<br />
from utils import server, un, ps<br />
<br />
<br />
async def main():<br />
&nbsp; &nbsp; async with async_playwright() as pl:<br />
&nbsp; &nbsp; &nbsp; &nbsp; browser = await pl.chromium.launch(headless=False)<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; context = await browser.new_context(<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; proxy={<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 'server': server,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 'username': un,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 'password': ps<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; })<br />
&nbsp; &nbsp; &nbsp; &nbsp; page = await context.new_page()<br />
&nbsp; &nbsp; &nbsp; &nbsp; await page.goto('https://dixy.ru')<br />
&nbsp; &nbsp; &nbsp; &nbsp; response = await context.request.get('https://dixy.ru/ajax/json.php?block=tree')<br />
&nbsp; &nbsp; &nbsp; &nbsp; response = await response.json()<br />
&nbsp; &nbsp; &nbsp; &nbsp; print('good')<br />
<br />
if __name__ == &quot;__main__&quot;:<br />
&nbsp; &nbsp; asyncio.run(main())</code><hr />
</div><b>ошибка целиком:</b><br />
<div style="margin:20px; margin-top:5px; ">
	<div class="smallfont" style="margin-bottom:2px">Цитата:</div>
	<table cellpadding="5" cellspacing="0" border="0" width="100%">
	<tr>
		<td class="alt2">
			<hr />
			
				Traceback (most recent call last):<br />
  File &quot;C:\Users\Lenov\AppData\Local\Programs\P ython\Python312\Lib\asyncio\runners.py&quot;, line 118, in run<br />
    return self._loop.run_until_complete(task)<br />
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^<br />
  File &quot;C:\Users\Lenov\AppData\Local\Programs\P ython\Python312\Lib\asyncio\base_events. py&quot;, line 691, in run_until_complete<br />
    return future.result()<br />
           ^^^^^^^^^^^^^^^<br />
  File &quot;c:\meandme\thegod\main.py&quot;, line 18, in main<br />
    await page.goto('https://dixy.ru')<br />
  File &quot;C:\meandme\thegod\god\Lib\site-packages\patchright\async_api\_generated .py&quot;, line 9160, in goto<br />
    await self._impl_obj.goto(<br />
  File &quot;C:\meandme\thegod\god\Lib\site-packages\patchright\_impl\_page.py&quot;, line 533, in goto<br />
    return await self._main_frame.goto(**locals_to_params (locals()))<br />
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^<br />
  File &quot;C:\meandme\thegod\god\Lib\site-packages\patchright\_impl\_frame.py&quot;, line 134, in goto<br />
    await self._channel.send(<br />
  File &quot;C:\meandme\thegod\god\Lib\site-packages\patchright\_impl\_connection.py &quot;, line 52, in send<br />
    return await self._connection.wrap_api_call(<br />
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^<br />
  File &quot;C:\meandme\thegod\god\Lib\site-packages\patchright\_impl\_connection.py &quot;, line 498, in wrap_api_call<br />
    return await cb()<br />
           ^^^^^^^^^^<br />
  File &quot;C:\meandme\thegod\god\Lib\site-packages\patchright\_impl\_connection.py &quot;, line 102, in _inner_send<br />
    done, _ = await asyncio.wait(<br />
              ^^^^^^^^^^^^^^^^^^^<br />
  File &quot;C:\Users\Lenov\AppData\Local\Programs\P ython\Python312\Lib\asyncio\tasks.py&quot;, line 464, in wait<br />
    return await _wait(fs, timeout, return_when, loop)<br />
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^<br />
  File &quot;C:\Users\Lenov\AppData\Local\Programs\P ython\Python312\Lib\asyncio\tasks.py&quot;, line 550, in _wait<br />
    await waiter<br />
asyncio.exceptions.CancelledError<br />
<br />
During handling of the above exception, another exception occurred:<br />
<br />
Traceback (most recent call last):<br />
  File &quot;c:\meandme\thegod\main.py&quot;, line 24, in &lt;module&gt;<br />
    asyncio.run(main())<br />
  File &quot;C:\Users\Lenov\AppData\Local\Programs\P ython\Python312\Lib\asyncio\runners.py&quot;, line 195, in run<br />
    return runner.run(main)<br />
           ^^^^^^^^^^^^^^^^<br />
  File &quot;C:\Users\Lenov\AppData\Local\Programs\P ython\Python312\Lib\asyncio\runners.py&quot;, line 123, in run<br />
    raise KeyboardInterrupt()<br />
KeyboardInterrupt
			
			<hr />
		</td>
	</tr>
	</table>
</div>Кто знает в чем дело, подскажите пожалуйста куда смотреть</div>

]]></content:encoded>
			<category domain="https://www.cyberforum.ru/python-beginners/">Python для начинающих</category>
			<dc:creator>Андриян1490</dc:creator>
			<guid isPermaLink="true">https://www.cyberforum.ru/python-beginners/thread3222765.html</guid>
		</item>
	</channel>
</rss>
