#! /usr/bin/env python3.4
#-*- coding:utf-8 -*-
#__author__ == "tyomcat"
import urllib.request
import random
import re
url='http://www.whatismyip.com.tw'
iplist=['121.193.143.249:80','112.126.65.193:80','122.96.59.104:82','115.29.98.139:9999','117.131.216.214:80','116.226.243.166:8118','101.81.22.21:8118','122.96.59.107:843']
proxy_support = urllib.request.ProxyHandler({'http':random.choice(iplist)})
opener=urllib.request.build_opener(proxy_support)
opener.addheaders=[('User-Agent','Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.87 Safari/537.36')]
urllib.request.install_opener(opener)
response = urllib.request.urlopen(url)
html = response.read().decode('utf-8')
pattern = re.compile('<h1>(.*?)</h1>.*?<h2>(.*?)</h2>')
iterms=re.findall(pattern,html)
for item in iterms:
print(item[0]+":"+item[1])
#! /usr/bin/env python
# -*- coding:utf-8 -*-
#__author__ == "tyomcat"
from selenium import webdriver
import time
import re
drive = webdriver.PhantomJS(executable_path='phantomjs-2.1.1-linux-x86_64/bin/phantomjs')
drive.get('https://mm.taobao.com/self/model_info.htm?user_id=189942305&is_coment=false')
time.sleep(5)
pattern = re.compile(r'<div.*?mm-p-domain-info">.*?class="mm-p-info-cell clearfix">.*?<li>.*?<label>(.*?)</label><span>(.*?)</span>',re.S)
html=drive.page_source.encode('utf-8','ignore')
items=re.findall(pattern,html)
for item in items:
print item[0],'http:'+item[1]
drive.close()
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有