编译环境搭建:
请自行百度。
无头浏览器Phantomjs是什么,怎么用:
请自行百度。
编译方法如下:
git clone https://github.com/openwrt/openwrt.git
cd openwrt
./scripts/feeds update -a
./scripts/feeds install -a
编译glibc-openwrt需要修改的makefile
package/feeds/packages/fontconfig/makefile
-----------
PKG_VERSION:=2.11.1
改成
PKG_VERSION:=2.13.1
-----------
PKG_HASH:=dc62447533bca844463a3c3fd4083b57c90f18a70506e7a9f4936b5a1e516a99
改成
PKG_HASH:=f655dd2a986d7aa97e052261b36aa67b0a64989496361eca8d604e6414006741
-----------
DEPENDS:=+libpthread +libexpat +libfreetype
改成
DEPENDS:=+libpthread +libexpat +libfreetype +libuuid +libiconv-full +libxml2
-----------
CONFIGURE_ARGS+= \
--with-cache-dir=/tmp/fontconfig/cache \
--with-arch=$(ARCH) \
--disable-iconv \
--disable-libxml2 \
--disable-docs
改成
CONFIGURE_ARGS+= \
--with-cache-dir=/tmp/fontconfig/cache \
--with-arch=$(ARCH) \
--disable-docs
-----------
make menuconfig
编译glibc-openwrt的必须选项:
Target System-->x86
Subtarget-->2G内存以下选Generic,4G以上选x86_64
勾选Adcanced configuration options(for devlopers)
勾选Adcanced configuration options(for devlopers)-->Toolchain Options
Adcanced configuration options(for devlopers)-->Toolchain Options-->binutils version-->选binutils 2.31.1
Adcanced configuration options(for devlopers)-->Toolchain Options-->GCC compiler Version-->选gcc 7.x
Adcanced configuration options(for devlopers)-->Toolchain Options-->C Libary implementation-->选Use glibc
Development-->勾选gcc
Development-->gcc-->Libraries-->勾选Include static libc on target、include static libptread on target、include static libstdc++ on target
Xorg-->Font-Utils-->勾选fontconfig
编译glibc-openwrt的可能是必须选项(建议都勾上):
Target Images-->Root filesystem partition size(in MB)-->建议至少200MB
Global build settings-->勾选Compile with full langeuage support
Global build settings-->referred standard C++ library-->选libstdc++
编译glibc-openwrt的可选选项:
Languages-->ython-->python3
Languages-->ython-->python3-pip
Languages-->ython-->python3-requests
Languages-->ython-->python3-setuptools(勾选python3-pip会自动选上)
编译glibc-openwrt的其他选项:
Luci等
make download V=s -j4(编译前先下载,非必选项)(glibc建议直接官网下载,然后自己改名字)
make V=99 -j4(等等等等)
编译完刷固件,怎么刷自行百度。
--------------------------------------------
用putty登陆路由器
selenium安装:
pip3 install selenium==2.48.0
--------------------------------------------
去https://phantomjs.org/download.html下载对应版本的Phantomjs,x86-generic选linux32-bit,x86-64选linux64-bit
解压缩
用winscp登录路由器
将解压缩后的文件夹里找到phantomjs(在bin下的)复制到路由器的/usr/bin,并赋予执行权限
-----------------------------------------------------------
phantomjs试运行:
用putty登陆路由器
python3
from selenium import webdriver
driver = webdriver.PhantomJS( service_args=['--ignore-ssl-errors=true'])
driver.get("http://www.baidu.com")
driver.page_source
运行结果:
请不要胡乱输入以及粘贴、复制等方式灌水
请尊重作者、并共同维护网站的正常阅读,否则账户将会被限制发帖、回帖,并且积分可能会被清零,站内短信以及阅读权限等都会受到影响,谢谢。
具体限制方式:https://www.right.com.cn/forum/thread-8307840-1-1.html
|