We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I looked through your code and found out that proxy meta value was set only when there was proxy_user_pass from proxy record:
def process_request(self, request, spider): # Don't overwrite with a random one (server-side state for IP) if 'proxy' in request.meta: if request.meta["exception"] is False: return request.meta["exception"] = False if len(self.proxies) == 0: raise ValueError('All proxies are unusable, cannot proceed') if self.mode == ProxyMode.RANDOMIZE_PROXY_EVERY_REQUESTS: proxy_address = random.choice(list(self.proxies.keys())) else: proxy_address = self.chosen_proxy proxy_user_pass = self.proxies[proxy_address] if proxy_user_pass: request.meta['proxy'] = proxy_address basic_auth = 'Basic ' + base64.b64encode(proxy_user_pass.encode()).decode() request.headers['Proxy-Authorization'] = basic_auth else: log.debug('Proxy user pass not found') log.debug('Using proxy <%s>, %d proxies left' % ( proxy_address, len(self.proxies)))
Have I missed smth?
The text was updated successfully, but these errors were encountered:
Agreed...it's missing the request.meta['proxy'] = proxy_address in the else statement.
request.meta['proxy'] = proxy_address
Sorry, something went wrong.
No branches or pull requests
I looked through your code and found out that proxy meta value was set only when there was proxy_user_pass from proxy record:
Have I missed smth?
The text was updated successfully, but these errors were encountered: