#324 聊一聊众 Webdrivers
浏览器自动化 爬虫 WebDriver Python Selenium Puppeteer Pyppeteer HeadlessBrowser 2019-06-20WebDriver 是浏览器自动化工具。
主要的用途:
- 自动化测试
- 爬虫
- 网页截图
知名的:
- Selenium
- Puppeteer
coding in a complicated world
WebDriver 是浏览器自动化工具。
主要的用途:
知名的:
function base64EncodeUnicode(str) {
// First we escape the string using encodeURIComponent to get the UTF-8 encoding of the characters,
// then we convert the percent encodings into raw bytes, and finally feed it to btoa() function.
utf8Bytes = encodeURIComponent(str).replace(
/%([0-9A-F]{2})/g,
function (match, p1) {
return String.fromCharCode("0x" + p1);
},
);
return btoa(utf8Bytes);
}
x.decode('utf-8').encode('raw_unicode_escape').decode('ascii')[2:].strip('0')
其实我没有怎么用过这个终端模拟器,用的多的还是 GNOME Terminal。
但这个灵活的 X11 终端模拟器,它的名字还是经常能在一些地方碰到的,比如 XShell、PuTTY 的配置中。
除了 xterm 之外,什么 Linux Console、rxvt、vt100、vt220、vt320 之类的,关于终端,可以说的太多。以后如果有空,对这个仔细了解之后再专门写一篇博客说这个吧!
理论上,可以看图之后,也可以看视频,甚至做更多复杂的事情。
https://en.wikipedia.org/wiki/Design_Patterns
https://en.wikipedia.org/wiki/Software_design_pattern
我们说的 23 中设计模式,是来自一本 1994 年出版的书:《Design Patterns: Elements of Reusable Object-Oriented Software》。
这本书的中文名字叫:《设计模式:可复用面向对象软件的基础》。
写这本书的四位作者,被人成为 GoF(Gang of Four),也就是四人帮的意思(因为我们这边的关系,这个词在西方也比较著名,所以...)。
其中定义了设计模式,就是类似的问题的一种解决方案,或者说优秀的设计风格、编码风格,提升代码重用,同时实现高内聚、低耦合,让程序会更加可理解,更加可拓展,更加可维护。
有些资料中还加入了一个:合成复用原则 Composite/Aggregate Reuse Principle,减少继承,多用聚合。
Syntax : location [ = | ~ | ~* | ^~ ] uri { ... }
location @name { ... }
Default: —
Context: server, location
= uri
) > 前缀匹配(^~ uri
/uri
) > 正则匹配(~
/~*
)。sudo apt install -y zerofree
sudo zerofree -v /dev/sdb1
VBoxManage modifymedium disk --compact /path/to/vdi
Invalid default value for 'update_time'
使用info-zip.org 的 unzip类 解压zip压缩包,如果压缩包中有中文文件名,那么解压这些文件出来时文件名是乱码的。
参考这篇文章 让 Unzip 正确解压其中包含中文文件名的 Winzip 压缩包链接失效 (注:疑似转载链接),原因是 unzip 试图将 zip 文件中用 oem(ibm-dos) codepage 编码的文件名转换成自己的内部编码。可惜 unzip 只能转换极少数几种 codepage,中文的 cp936 不在其列。