上一页 1 2 3 4 5 6 7 ··· 9 下一页
摘要: 0. 1.问题 1.1现象: nginx error.log 提示 [error] 887#887: *58 FastCGI sent in stderr: "PHP message: PHP Warning: mysql_connect(): Headers and client library 阅读全文
posted @ 2017-12-14 15:33 my8100 阅读(3198) 评论(0) 推荐(0) 编辑
摘要: 现象: PHP查询数据库较慢,大约 60s 后 nginx 返回 504:Sorry, the page you are looking for is currently unavailable. 检查log: 从 /etc/nginx/nginx.conf 找到 /var/log/nginx/ac 阅读全文
posted @ 2017-12-13 18:13 my8100 阅读(2593) 评论(0) 推荐(0) 编辑
摘要: 0. 1.参考 网页编码就是那点事 阮一峰 字符编码笔记:ASCII,Unicode 和 UTF-8 2.总结 美国 ASCII 码 发音: /ˈæski/ :128个字符,只占用了一个字节的后面7位,最前面的一位统一规定为0。 非 ASCII 编码: 欧洲:ISO 8859-1,又称Latin-1 阅读全文
posted @ 2017-11-01 14:33 my8100 阅读(632) 评论(0) 推荐(0) 编辑
摘要: 0. 1.参考 Python正则表达式指南 https://docs.python.org/2/library/re.html https://docs.python.org/2/howto/regex.html https://docs.python.org/3/library/re.html 2 阅读全文
posted @ 2017-10-30 10:34 my8100 阅读(326) 评论(0) 推荐(0) 编辑
摘要: 0. 1.参考 Python 爬虫:把廖雪峰教程转换成 PDF 电子书 https://github.com/lzjun567/crawler_html2pdf wkhtmltopdf 就是一个非常好的工具,它可以用适用于多平台的 html 到 pdf 的转换,pdfkit 是 wkhtmltopd 阅读全文
posted @ 2017-10-28 18:53 my8100 阅读(12537) 评论(1) 推荐(0) 编辑
摘要: 0. requests不设置UA 访问baidu 得到 r.headers['Content-Type'] 是text/html 使用chrome UA: Content-Type:text/html; charset=utf-8 1.参考 代码分析Python requests库中文编码问题 is 阅读全文
posted @ 2017-10-26 16:22 my8100 阅读(3190) 评论(0) 推荐(0) 编辑
摘要: 0. 1.参考 W3C HTML 表格 表格标签 表格元素定位 参看网页源代码并没有 thead 和 tbody。。。 2.提取表格数据 表格标题可能出现超链接,导致标题被拆分, 也可能不带表格标题。。 表格内容换行 tag 规律 2.1提取所有表格标题列表 2.2每个表格分别写入csv文件 代码处 阅读全文
posted @ 2017-10-22 16:11 my8100 阅读(13081) 评论(0) 推荐(0) 编辑
摘要: 0.目录 1.参考2.问题定位不间断空格的unicode表示为 u\xa0',超出gbk编码范围?3.如何处理.extract_first().replace(u'\xa0', u' ').strip().encode('utf-8','replace') 1.参考 Beautiful Soup a 阅读全文
posted @ 2017-10-22 13:06 my8100 阅读(5972) 评论(0) 推荐(0) 编辑
摘要: 0. 1.参考 《用Python写网络爬虫》——2.2 三种网页抓取方法 re / lxml / BeautifulSoup 需要注意的是,lxml在内部实现中,实际上是将CSS选择器转换为等价的XPath选择器。 从结果中可以看出,在抓取我们的示例网页时,Beautiful Soup比其他两种方法 阅读全文
posted @ 2017-10-20 17:33 my8100 阅读(3158) 评论(1) 推荐(1) 编辑
摘要: 0. 1.参考 https://github.com/scrapy-plugins/scrapy-splash#configuration 以此为准 scrapy相关:splash安装 A javascript rendering service 渲染 2.实践 2.1新建项目后修改 setting 阅读全文
posted @ 2017-10-19 17:56 my8100 阅读(616) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 ··· 9 下一页