Skip to content
This repository has been archived by the owner on Jun 18, 2022. It is now read-only.

非Python程序猿 问个代码上的问题 #6

Open
gMan1990 opened this issue May 14, 2020 · 1 comment
Open

非Python程序猿 问个代码上的问题 #6

gMan1990 opened this issue May 14, 2020 · 1 comment

Comments

@gMan1990
Copy link

gMan1990 commented May 14, 2020

self.proxies = received

        oldcount = len(self.proxies)
        try:
            received = self.find_proxies(page)
        except Exception as e:
            received = []
            log.error(
                'Error when executing find_proxies.'
                'Domain: %s; Error: %r' % (self.domain, e)
            )
        self.proxies = received

我的理解 received = self.find_proxies(page) 从当前页找到代理,然后 self.proxies = received 赋值给了实例的proxies属性,看起来是第1页找到10个,len(self.proxies)=10,然后第2页找到20个,赋值一下,len(self.proxies)=20了,但实际执行情况又不是,self.proxies是合并的结果,所以合并数组的代码在哪?

@derekhe
Copy link
Owner

derekhe commented May 22, 2020

这个我没有具体跟踪过他的代码,可以尝试打个断点看看

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants