Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7981917
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T10:31:17+00:00 2026-06-04T10:31:17+00:00

I have a script which works fine on my old Windows XP computer but

  • 0

I have a script which works fine on my old Windows XP computer but I need to get it working on Windows 7. So I’ve installed all the needed modules & Cie. But I still get some strange errors and after five hours looking over the internet, I guess that some good soul here can give me a hand.

So here is the problematic function of my script:

from gevent import monkey
import gevent
import requests
from requests import async
import xlwt
from bs4 import BeautifulSoup as soup
from urllib2 import urlopen
import time
from twisted.web import client
from twisted.internet import reactor, defer
import re
import os
import urllib
import random
import sys
import re
import logging
from threading import RLock

logging.basicConfig(level=logging.INFO)
log = logging.getLogger()

from grab.spider import Spider, Task



def BULATS_TC():
    ''' FETCHING BULATS AGENTS '''
    x = 0
    START_BULATS_TC = time.time()
    ws = wb.add_sheet("BULATS_AGENTS")
    Page_List = ['0','1','2','3','4','5','6','7','8','9','10','11','12','13','14','15','16','17','18','19', '20']
    to_send = []

    def parse(response):
        global x
        html = soup(response.text)
        tableau = html.find('table')
        try:
            rows = tableau.findAll('tr')
            for tr in rows:
                cols = tr.findAll('td')
                y = 0
                x = x + 1
                for td in cols:
                    texte_bu = td.text
                    texte_bu = texte_bu.encode('utf-8')
                    texte_bu = texte_bu.strip()
                    ws.write(x,y,texte_bu)
                    y = y + 1
        except (IndexError, AttributeError):
            pass

    for Page in Page_List:
        r = requests.async.get('http://www.bulats.org/agents/find-an-agent?field_continent_tid=All&field_country_tid=All&page=%s' % Page, timeout=20)
        to_send.append(r)

    responses = requests.async.map(to_send)
    parse_jobs = [gevent.spawn(parse, resp) for resp in responses]
    gevent.joinall(parse_jobs)

    ELAPSED_TIME_BULATS_AGENTS = time.time() - START_BULATS_TC
    return ELAPSED_TIME_BULATS_AGENTS

And here is the error I get in my terminal :

exceptions.IOError: [Errno 0] No error
Restarting gevent.core.dispatch() after an error [1928]: [Errno 0] No error
Unhandled Error
Traceback (most recent call last):
  File "C:\Users\Admin\Desktop\EAGLE_DATA_UPDATE.py", line 509, in <module>
    BULATS_IA_TIME = BULATS_IA()
  File "C:\Users\Admin\Desktop\EAGLE_DATA_UPDATE.py", line 430, in BULATS_IA
    reactor.run()
  File "C:\Python27\lib\site-packages\twisted\internet\base.py", line 1169, in r
un
    self.mainLoop()
--- <exception caught here> ---
  File "C:\Python27\lib\site-packages\twisted\internet\base.py", line 1181, in m
ainLoop
    self.doIteration(t)
  File "C:\Python27\lib\site-packages\twisted\internet\selectreactor.py", line 1
04, in doSelect
    [], timeout)
  File "C:\Python27\lib\site-packages\twisted\internet\selectreactor.py", line 3
6, in win32select
    r, w, e = select.select(r, w, w, timeout)
  File "C:\Python27\lib\site-packages\gevent\select.py", line 63, in select
    result.event.wait(timeout=timeout)
  File "C:\Python27\lib\site-packages\gevent\event.py", line 74, in wait
    result = get_hub().switch()
  File "C:\Python27\lib\site-packages\gevent\hub.py", line 164, in switch
    return greenlet.switch(self)
  File "C:\Python27\lib\site-packages\gevent\hub.py", line 179, in run
    result = core.dispatch()
  File "core.pyx", line 398, in gevent.core.dispatch (gevent/core.c:5404)

exceptions.IOError: [Errno 0] No error
Restarting gevent.core.dispatch() after an error [1929]: [Errno 0] No error
Unhandled error in Deferred:
Unhandled Error
Traceback (most recent call last):
Failure: twisted.internet.defer.FirstError: FirstError[#2, [Failure instance: Tr
aceback (failure with no frames): <class 'twisted.internet.error.TimeoutError'>:
 User timeout caused connection failure.
]]

I think that my connexion is not very stable (I’m in China) so maybe I need to set up a bigger timeout, but with requests and my script I don’t know how to proceed.

I hope that it’s all clear enough.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T10:31:19+00:00Added an answer on June 4, 2026 at 10:31 am

    I finally got it working by reinstalling Twisted.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hi I have the following script which works fine running on IIS but when
I have the following script which works fine: $.ajax({ url: 'serverside_script', type: 'GET', dataType:
I have a PHP script which works fine in PHP 5, but not in
I have this simple script which works fine, but currently overwrites files with duplicate
Okay, so I have this script which works fine with IE but won't work
Hi all i have the following merge sql script which works fine for a
I have written a script which works, but I'm guessing isn't the most efficient.
I have a tooltip script which uses the mousemove jquery function. Everything works fine
I have the following lua script : module(modoo,package.seeall) foo=1 bar={12,34} Which works fine using
I have the following Ruby script that creates a Debian package, which works fine:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.