Guest User

Untitled

a guest
Nov 8th, 2018
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.50 KB | None | 0 0
  1. https://<user>:<pass>@xecdapi.xe.com/v1/convert_from.json/?from=1000000&to=SGD&amount=AED,AUD,BDT&inverse=True
  2.  
  3. yield scrapy.Request("https://<user>:<pass>@xecdapi.xe.com/v1/convert_from.json/?from=1000000&to=SGD&amount=AED,AUD,BDT&inverse=True")
  4.  
  5. It returns this error:
  6.  
  7. Traceback (most recent call last):
  8. File "d:kerjahitpython~1<project_name><project_name>libsite-packagestwistedinternetdefer.py", line 1297, in _inlineCallbacks
  9. result = result.throwExceptionIntoGenerator(g)
  10. File "d:kerjahitpython~1<project_name><project_name>libsite-packagestwistedpythonfailure.py", line 389, in throwExceptionIntoGenerator
  11. return g.throw(self.type, self.value, self.tb)
  12. File "d:kerjahitpython~1<project_name><project_name>libsite-packagesscrapycoredownloadermiddleware.py", line 43, in process_request
  13. defer.returnValue((yield download_func(request=request,spider=spider)))
  14. File "d:kerjahitpython~1<project_name><project_name>libsite-packagesscrapyutilsdefer.py", line 45, in mustbe_deferred
  15. result = f(*args, **kw)
  16. File "d:kerjahitpython~1<project_name><project_name>libsite-packagesscrapycoredownloaderhandlers__init__.py", line 65, in download_request
  17. return handler.download_request(request, spider)
  18. File "d:kerjahitpython~1<project_name><project_name>libsite-packagesscrapycoredownloaderhandlershttp11.py", line 61, in download_request
  19. return agent.download_request(request)
  20. File "d:kerjahitpython~1<project_name><project_name>libsite-packagesscrapycoredownloaderhandlershttp11.py", line 286, in download_request
  21. method, to_bytes(url, encoding='ascii'), headers, bodyproducer)
  22. File "d:kerjahitpython~1<project_name><project_name>libsite-packagestwistedwebclient.py", line 1596, in request
  23. endpoint = self._getEndpoint(parsedURI)
  24. File "d:kerjahitpython~1<project_name><project_name>libsite-packagestwistedwebclient.py", line 1580, in _getEndpoint
  25. return self._endpointFactory.endpointForURI(uri)
  26. File "d:kerjahitpython~1<project_name><project_name>libsite-packagestwistedwebclient.py", line 1456, in endpointForURI
  27. uri.port)
  28. File "d:kerjahitpython~1<project_name><project_name>libsite-packagesscrapycoredownloadercontextfactory.py", line 59, in creatorForNetloc
  29. return ScrapyClientTLSOptions(hostname.decode("ascii"), self.getContext())
  30. File "d:kerjahitpython~1<project_name><project_name>libsite-packagestwistedinternet_sslverify.py", line 1201, in __init__
  31. self._hostnameBytes = _idnaBytes(hostname)
  32. File "d:kerjahitpython~1<project_name><project_name>libsite-packagestwistedinternet_sslverify.py", line 87, in _idnaBytes
  33. return idna.encode(text)
  34. File "d:kerjahitpython~1<project_name><project_name>libsite-packagesidnacore.py", line 355, in encode
  35. result.append(alabel(label))
  36. File "d:kerjahitpython~1<project_name><project_name>libsite-packagesidnacore.py", line 276, in alabel
  37. check_label(label)
  38. File "d:kerjahitpython~1<project_name><project_name>libsite-packagesidnacore.py", line 253, in check_label
  39. raise InvalidCodepoint('Codepoint {0} at position {1} of {2} not allowed'.format(_unot(cp_value), pos+1, repr(label)))
  40. InvalidCodepoint: Codepoint U+003A at position 28 of u'xxxxxxxxxxxxxxxxxxxxxxxxxxxx:xxxxxxxxxxxxxxxxxxxxxxxxxxx@xecdapi' not allowed
  41.  
  42. DOWNLOADER_MIDDLEWARES = {
  43. 'scrapy.downloadermiddlewares.httpauth.HttpAuthMiddleware': 811,
  44. }
  45.  
  46. from scrapy.spiders import CrawlSpider
  47.  
  48. class SomeIntranetSiteSpider(CrawlSpider):
  49.  
  50. http_user = 'someuser'
  51. http_pass = 'somepass'
  52. name = 'intranet.example.com'
  53.  
  54. # .. rest of the spider code omitted ...
Add Comment
Please, Sign In to add comment