玩linux就是不断的踩坑,踩坑。最近的坑。xpath firefox兼容问题,抓取表格。
最近在抓取一个页面表格时发现,用firefox提取的xpath,不能用,仔细分析后,发现是提取的xpath多了一个tbody标签。在xpath路径中删掉这段就好了。
last_A5='/html/body/div[1]/table/tbody/tr/td/table[2]/tbody/tr[2]/td[2]'
last_A5='/html/body/div[1]/table/tr/td/table[2]/tbody/tr[2]/td[2]'
https://github.com/tiangolo/uwsgi-nginx-flask-docker
这个镜像装不上lxml包。最后分析是因为它的基础包 python:3.6-alpine3.7有问题,装不上lxml。估计要顺着几个包的dockerfile,全部down下来,基于alpine3.7来重构。
在alpine下 用apk add py3-lxml来安装python模块 lxml
#FROM tiangolo/uwsgi-nginx-flask:python3.6-alpine3.7
#FROM alpine:3.7
FROM python:3.6-alpine3.7
RUN apk update add python3
RUN apk add py3-lxml
RUN pip3 install pip==10.0.0
RUN pip3 freeze
now ,i test from python3.6-alpine3.7 just like you base.base ,it will not install modeule.
so some problems in python3.6-alpine3.7.
maybe you Should change you base to alpine3.7 and install python3.