Comments (12)
my guess is that you would need to use asyncio.new_event_loop()
instead of asyncio.get_event_loop()
.
But instead of guessing, giving a minimally reproducible example would be more beneficial.
from proxybroker2.
I use Windows. I'm using the sample code from the readme:
import asyncio
from proxybroker import Broker
async def show(proxies):
while True:
proxy = await proxies.get()
if proxy is None: break
print('Found proxy: %s' % proxy)
proxies = asyncio.Queue()
broker = Broker(proxies)
tasks = asyncio.gather(
broker.find(types=['HTTP',], limit=10),
show(proxies))
loop = asyncio.get_event_loop()
loop.run_until_complete(tasks)
I get the following error:
PS D:\GitRepo\PythonTest> & d:/GitRepo/PythonTest/.venv/Scripts/python.exe d:/GitRepo/PythonTest/ProxyBroker2.py
Traceback (most recent call last):
File "d:\GitRepo\PythonTest\ProxyBroker2.py", line 11, in <module>
broker = Broker(proxies)
^^^^^^^^^^^^^^^
File "D:\GitRepo\PythonTest\.venv\Lib\site-packages\proxybroker\api.py", line 69, in __init__
self._resolver = Resolver(loop=self._loop)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\GitRepo\PythonTest\.venv\Lib\site-packages\proxybroker\resolver.py", line 48, in __init__
self._resolver = aiodns.DNSResolver(loop=self._loop)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\GitRepo\PythonTest\.venv\Lib\site-packages\aiodns\__init__.py", line 55, in __init__
raise RuntimeError(
RuntimeError: aiodns needs a SelectorEventLoop on Windows. See more: https://github.com/saghul/aiodns/issues/86
PS D:\GitRepo\PythonTest>
I studied the link (saghul/aiodns#86), but it is not clear how to fix it! I ask for help in fixing the problem!
from proxybroker2.
Does this problem have a solution?
from proxybroker2.
yes
#147 (comment)
it is the only workaround for now
from proxybroker2.
What exactly should be done? In the provided answer, it is not clear exactly what actions are needed!
from proxybroker2.
Please look at this example
from proxybroker2.
PS D:\GitRepo\PythonTest> & d:/GitRepo/PythonTest/.venv/Scripts/python.exe d:/GitRepo/PythonTest/ProxyBroker2.py
D:\GitRepo\PythonTest.venv\Lib\site-packages\proxybroker\providers.py:77: DeprecationWarning: The object should be created within an async function
async with aiohttp.ClientSession(
D:\GitRepo\PythonTest.venv\Lib\site-packages\aiohttp\connector.py:776: DeprecationWarning: The object should be created within an async function
super().init(
D:\GitRepo\PythonTest.venv\Lib\site-packages\aiohttp\cookiejar.py:84: DeprecationWarning: The object should be created within an async function
super().init(loop=loop)
from proxybroker2.
What python version are you running?
from proxybroker2.
3.12
from proxybroker2.
oh i forgot, my pull request haven't been merged yet. PR #147 will fix this.
from proxybroker2.
what specific action should be done? Nothing is clear in this discussion
from proxybroker2.
add the following code after you import asyncio
if sys.platform == 'win32':
asyncio.set_event_loop_policy(asyncio.WindowsSelectorEventLoopPolicy())
from proxybroker2.
Related Issues (20)
- Proxy Broker in windows 11 HOT 2
- Docker serve not working, but ran pip working ok HOT 4
- How to grab only http - https HOT 1
- How can i static ip?
- tracemalloc error
- Is this project still working
- How do I properly use this? HOT 4
- NotImplementedError: HOT 2
- Observations--not complaint
- only verify proxies using txt file input
- Some socks5 proxies don't work with HTTPS/SSL
- SOCKS5 Server
- to windows does not work HOT 1
- Checking proxy on protocols ['HTTP', 'CONNECT:80', 'SOCKS4', 'SOCKS5', 'HTTPS', 'SMTP'] is disabled. HOT 1
- `Serve` Does not work. HOT 10
- `Update-geo` does not work
- DeprecationWarning: Using send() method on sockets returned from get_extra_info('socket') will
- find and save not working
- How to Auto-Rotate?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from proxybroker2.