上一页 1 ··· 15 16 17 18 19 20 21 22 23 ··· 38 下一页
摘要: forscala> for(i for(i for(i for(i val newArr = for(a for(e <- 1 to 10 if e % 2 == 0) print(e + " ")2 4 6 8 10 阅读全文
posted @ 2018-12-29 08:59 xuejianbest 阅读(216) 评论(0) 推荐(0) 编辑
摘要: 定义一个长度不变的整型数组:val a = new Array[int](10) //Array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0)定义有初值的数组,不用newval s = Array("a", "b") //长度为2的Array[... 阅读全文
posted @ 2018-12-29 08:59 xuejianbest 阅读(174) 评论(0) 推荐(0) 编辑
摘要: 原理:生成一个随机的BigInt,然后将它转化为36进制。BigInt可以表示任意大的整数。BigInt(2000, scala.util.Random).toString(36) 阅读全文
posted @ 2018-12-29 08:59 xuejianbest 阅读(1246) 评论(0) 推荐(0) 编辑
摘要: Selenium在定位的class含有空格的复合类的解决办法:driver.find_element_by_css_selector("[class='j-inputtext dlemail']").send_keys("yoyo") 阅读全文
posted @ 2018-12-28 09:05 xuejianbest 阅读(1673) 评论(0) 推荐(0) 编辑
摘要: 安装scala运行解释器下载scala,解压,配置SCALA_HOME到解压目录,将$SCALA_HOME/bin加入PATHvim /etc/profileexport SCALA_HOME=/opt/scala-2.11.8export PATH=SCA... 阅读全文
posted @ 2018-12-28 09:05 xuejianbest 阅读(197) 评论(0) 推荐(0) 编辑
摘要: selenium常用操作:from selenium import webdriverfrom selenium.webdriver.common.by import Byfrom selenium.webdriver.support.ui import W... 阅读全文
posted @ 2018-12-28 09:05 xuejianbest 阅读(1455) 评论(0) 推荐(0) 编辑
摘要: Ubuntu使用chromiumsudo apt-get install -y chromium-browser # 安装浏览器,这部必须,如果只手动安装运行会报错,缺少依赖。或者看这个安装新版浏览器并用binary_location指定位置(需要科学上网)... 阅读全文
posted @ 2018-12-28 09:05 xuejianbest 阅读(2795) 评论(0) 推荐(0) 编辑
摘要: selenium挂ss代理爬取网页内容from selenium import webdriverfrom selenium.webdriver.chrome.options import Optionsfrom selenium.common.except... 阅读全文
posted @ 2018-12-28 09:05 xuejianbest 阅读(1) 评论(0) 推荐(0) 编辑
摘要: 此笔记没有做太多实验,仅做参考,具体情况还要查看文档:https://www.crummy.com/software/BeautifulSoup/bs4/doc.zh/#id4初始化:from bs4 import BeautifulSoup # 从文件获取... 阅读全文
posted @ 2018-12-28 09:05 xuejianbest 阅读(259) 评论(0) 推荐(0) 编辑
摘要: 开始我用BeautifulSoup分析网页时候这样做:#从文件读取html源文件内容with open("html.txt", "r", encoding='utf-8') as file: content = file.read() #替换转义... 阅读全文
posted @ 2018-12-28 09:05 xuejianbest 阅读(436) 评论(0) 推荐(0) 编辑
上一页 1 ··· 15 16 17 18 19 20 21 22 23 ··· 38 下一页