V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
V2EX  ›  bytelee  ›  全部回复第 16 页 / 共 19 页
回复总数  364
1 ... 8  9  10  11  12  13  14  15  16  17 ... 19  
❮ ❯
2016 年 2 月 29 日
回复了 billion 创建的主题 › 奇思妙想 › 写一句话在这里,下一个 2 月 29 号来看
财务自由 身体健康
2016 年 2 月 29 日
回复了 SoulClinic 创建的主题 › 酷工作 › 有技术能力够屌的 noder/iOSer/React.jser 吗?
iOS 现在都算前段了?
@meican 请问北京具体坐标 :)
2016 年 1 月 24 日
回复了 bytelee 创建的主题 › Python › 求助 关于 pyspider 使用多代理
@binux 最新更新

我尝试去掉了 @config 这些,直接在 self.craw 里边 加了 age 和 auto recaw,现在基本没问题了。

所以可能是我在使用 config 的时候使用的有些问题。
2016 年 1 月 24 日
回复了 bytelee 创建的主题 › Python › 求助 关于 pyspider 使用多代理
@binux 是的 多谢提醒 昨天测试没问题 很赞的工具。不过有一个疑问,关于 every 和 age 的使用。我看文档不是很多。现在我用 itag 每次修改完后强制重新 load 一次。但是有个问题是这之后就一直不自动运行了,经常输出:

pyspider task done :on_start data:,on_start

是不是我的配置有问题?

from pyspider.libs.base_handler import *
import re
import datetime

class Handler(BaseHandler):
crawl_config = {
"itag":"v0.0.6"
}

@every(minutes=3)
@config(age=3*60)
def on_start(self):
self.crawl('http://www..com.cn/', callback=self.index_page)

@every(minutes=3)
@config(age=3*60)
def index_page(self, response):
for each in response.doc('a[href^="http"]').items():
href = each.attr.href
if re.match("http://www.xxxx.com.cn/gonglu/[^_]*/", href, re.U):
self.crawl(each.attr.href, callback=self.detail_page,save={'main_road_name':each.text()}, retries=10, auto_recrawl =True)

def detail_page(self, response):
road_name = response.save.get('main_road_name', '')
road_img_url = ""

for img_item in response.doc('td.hcenter > img').items():
road_img_url = img_item.attr.src

for each in response.doc('.roadlineB > li > a').items():
href = each.attr.href
if re.match("http://www.xxx.com.cn/gonglu/gaosu_[^cs]\w*/", href, re.U):
city_road_name = each.text()
self.crawl(each.attr.href, callback=self.detail_page,save={'main_road_name':road_name, 'city_road_name':city_road_name}, retries =10, auto_recrawl=True)

messages = []
for each in response.doc(".LKlistleftE > p").items():
message = each.text()
info = self.process_message(message)
if info:
messages.append(info)
city_road_name = response.save.get('city_road_name', '')
return dict(main_road_name=road_name, city_road_name=city_road_name, messages=messages, road_img_url=road_img_url)

def process_message(self, message):
return dict(content=message)

这是我的代码,不知道是不是有问题。

谢谢
2016 年 1 月 23 日
回复了 bytelee 创建的主题 › Python › 求助 关于 pyspider 使用多代理
2016 年 1 月 23 日
回复了 bytelee 创建的主题 › Python › 求助 关于 pyspider 使用多代理
多谢,居然忘了 @binux :)
2015 年 12 月 30 日
回复了 bitbegin 创建的主题 › NGINX › 老罗提到的 openresty 是干啥的?就是 nginx 打个包?
这东西很好用
2015 年 12 月 17 日
回复了 vincentxue 创建的主题 › iDev › [小测试] 以下情景中有哪些会造成循环引用?
还要分情况讨论 ARC MRC 这里边的表现也不同.
PS: 如果能贴上正确结论 就更好了
2015 年 10 月 9 日
回复了 snowspace 创建的主题 › iDev › 苹果审核 app 会用模拟器吗?
apple 能够修改你的 ipa 然后在任何他们想测试的设备上跑。他们不用模拟器。最起码我没见过
2015 年 9 月 20 日
回复了 fhefh 创建的主题 › iDev › 安全快速下载 Xcode 的姿势 ~~~~
腾讯就靠谱么 问题是 就和他们一直很有道德一样。。。。
经常用电脑 高中毕业就做了 目前没什么异样 不知道老了会不会有问题
@kingwrcy 恩呢 就是不能登陆了。我说的版本能登陆。支持最新验证码格式了
买票?如果你越狱了我给你iOS版本的 :)
2015 年 3 月 5 日
回复了 kisshere 创建的主题 › 分享发现 › 大伙儿看看这个,国内 IT 行业真的有这么黑暗吗?
@WildCat 这是奇葩
2015 年 3 月 5 日
回复了 luyiyuan129 创建的主题 › 北京 › 北京车牌摇号,屡摇不中,怎么办?
@bytelee 我租过一个 一个月1k,没碰到什么危险
2015 年 3 月 5 日
回复了 kisshere 创建的主题 › 分享发现 › 大伙儿看看这个,国内 IT 行业真的有这么黑暗吗?
那以后在自己的app里边做广告收入,是不是也要这样搞了?
2015 年 2 月 26 日
回复了 luyiyuan129 创建的主题 › 北京 › 北京车牌摇号,屡摇不中,怎么办?
租个吧 先买个便宜点的车开着 摇上号再置换
http://25.io/ 这不就是Mou的官网么
@oimotis cool! 感谢楼主
1 ... 8  9  10  11  12  13  14  15  16  17 ... 19  
❮ ❯
About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   1005 Online   Highest 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 36ms · UTC 23:15 · PVG 07:15 · LAX 15:15 · JFK 18:15
♥ Do have faith in what you're doing.