一、安装httpd
二、安装php
三、安装mysql
四、下载相应页面
代码语言:javascript复制wget --no-check-certificate http://www.heanny.cn
或者ctrl s保存网页
代码语言:javascript复制from selenium import webdriver
from pymouse import PyMouse
from pykeyboard import PyKeyboard
from pyexcel_xls import get_data
import time,os
from bs4 import BeautifulSoup
def SaveUrlHtml(url):
try:
browser.get("https://{}".format(url))
time.sleep(8)
m=PyMouse()
k = PyKeyboard()
k.press_key(k.control_key)
k.tap_key('s')
k.release_key(k.control_key)
print('ctrl s')
time.sleep(2)
m.click(430,58,1)
time.sleep(1)
k.type_string('D:/lzh_www.heanny.cn/huchuang_test/PyCharmDemo/Chengde/{}'.format(url))
print('write path')
time.sleep(1)
k.press_key(k.enter_key)
time.sleep(3)
# m.click(366,408,1)
# time.sleep(0.1)
# m.click(450,430,1)
# time.sleep(0.1)
m.click(410,383,1)
k.type_string('index.html'.format(url))
time.sleep(1)
k.press_key(k.enter_key)
print('save:',url)
time.sleep(1)
k.press_key('y')
time.sleep(1)
return
except Exception as e:
print( e)
return
f = get_data('2.xlsx')
for i in f:
browser = webdriver.Chrome()
for url in f[i]:
print('open:',url)
SaveUrlHtml(url[0])
browser.close()
(以上为模拟浏览器并自动保存页面)
五、配置httpd
vi /etc/httpd/conf/httpd.conf 最后添加下面内容
代码语言:javascript复制<VirtualHost 118.195.68.34>
DocumentRoot /var/www/html/www.ch.21vianet.com
ServerName www.ch.21vianet.com
</VirtualHost>
然后再centos 7网卡下挂ip
代码语言:javascript复制ifconfig eth1:1 42.81.144.191 netmask 255.255.255.255
添加指定路由
代码语言:javascript复制ip route add 42.81.144.191/32 via 192.168.10.3 dev eth1
(目标) (下一跳) (网口)