url

/How to get active Tab url in safari browser using java script

烂漫一生 提交于 2020-01-23 14:02:29
问题 How to get the browser window or active tab url using java script in a safari browser ? I tried to do it using -> document.url window.location.href But both this solutions are giving me so many urls . I dont know why ? Also I have searched that safari.application.browserWindow.activeTab gives obj of current active window . But I dont know which methods are provided by activeTab class If anyone knows , plz help me . Thanks in advance. 回答1: If you just want the URL of the "top" document in the

parsley之验证属性设置

假装没事ソ 提交于 2020-01-23 13:59:20
parsley.js添加表单验证功能,直接在html元素中添加对应属性; Name API Description Required #2.0 必填 required HTML5 data-parsley-required data-parsley-required="true" data-parsley-required="false" 验证元素是否必填。如果设置 data-parsley-required="false" ,,属性失效,元素将不再必填; Email #2.0 邮箱 type="email" HTML5 data-parsley-type="email" 验证元素的值必须是一个邮箱地址; Number #2.0 数值 data-parsley-type="number" 依据给定的步长、初始值、最小值等设置数值的验证规则。 parsley为data-parsley-type="number"(验证数值类型)设置步长,步长为html5的默认步长1。 警告!HTML5 type="number" 是非常规的。 默认步长为1几乎是无用的。此外浏览器也支持 type="number" ,当输入内容为 "" ,不会报错;所以data-parsley-type="number"为避免输入的值为""需要设置必填。可为任何数。 Integer #2.0 整数 type=

Java爬虫

末鹿安然 提交于 2020-01-23 13:14:43
  1.网络爬虫 是一个自动提取网页的程序,它为搜索引擎从万维网上下载网页,是搜索引擎的重要组成。传统爬虫从一个或若干初始网页的URL开始,获得初始网页上的URL,在抓取网页的过程中,不断从当前页面上抽取新的URL放入队列,直到满足系统的一定停止条件。    2. 那么程序获取网页的原理到底是怎么回事呢?看下面的图:客服端首先向服务器端发出Http请求,之后服务器端 返回相应的结果 或者 请求超时 客户端自己报错。   服务器端发出的Http请求,实际上说是对服务器的文件的请求。下面的表格是一些常见的HTTP请求对应的文件。(因为第一列给出的都是主机的网址信息,主机一般都通过配置文件将该请求转换为 网站主页地址 index.php或index.jsp或者index.html等) 3.Java爬虫的代码实现 1)dbcp.properties `########DBCP配置文件########## #驱动名 driverClassName=com.mysql.jdbc.Driver #url url=jdbc:mysql://127.0.0.1:3306/peoper?useSSL=false #用户名 username=root #密码 password=sbj174615 #初试连接数 initialSize=30 #最大活跃数 maxTotal=30 #最大idle数

网络爬虫技术总结

两盒软妹~` 提交于 2020-01-23 11:47:45
网络爬虫技术总结 http://mp.weixin.qq.com/s?__biz=MzI3MTI2NzkxMA==&mid=2247484132&idx=1&sn=8db587fabc3c630decf0419b6130770e&scene=23&srcid=0720ZByjAlOM9YC5c76N9uKU#rd   对于大数据行业,数据的价值不言而喻,在这个信息爆炸的年代,互联网上有太多的信息数据,对于中小微公司,合理利用爬虫爬取有价值的数据,是弥补自身先天数据短板的不二选择,本文主要从爬虫原理、架构、分类以及反爬虫技术来对爬虫技术进行了总结。 1、爬虫技术概述 网络爬虫(Web crawler),是一种按照一定的规则,自动地抓取万维网信息的程序或者脚本,它们被广泛用于互联网搜索引擎或其他类似网站,可以自动采集所有其能够访问到的页面内容,以获取或更新这些网站的内容和检索方式。从功能上来讲,爬虫一般分为数据采集,处理,储存三个部分。 传统爬虫从一个或若干初始网页的URL开始,获得初始网页上的URL,在抓取网页的过程中,不断从当前页面上抽取新的URL放入队列,直到满足系统的一定停止条件。聚焦爬虫的工作流程较为复杂,需要根据一定的网页分析算法过滤与主题无关的链接,保留有用的链接并将其放入等待抓取的URL队列。然后,它将根据一定的搜索策略从队列中选择下一步要抓取的网页URL

Tampermonkey中文文档

拜拜、爱过 提交于 2020-01-23 11:31:22
Userscript Header @name @namespace @version @author @description @homepage, @homepageURL, @website and @source @icon, @iconURL and @defaulticon @icon64 and @icon64URL @updateURL @downloadURL @supportURL @include @match @exclude @require @resource @connect @run-at @grant @noframes @unwrap @nocompat Application Programming Interface unsafeWindow Subresource Integrity GM_addStyle(css)(TM4.0+弃用) GM_deleteValue(name) GM_listValues() GM_addValueChangeListener(name, function(name, old_value, new_value, remote) {}) GM_removeValueChangeListener(listener_id) GM_setValue(name, value) GM_getValue(name,

How To Change Image Sizes in Racket

坚强是说给别人听的谎言 提交于 2020-01-23 11:18:51
问题 I am making a game using racket and need a background bitmap image. But the image I have selected is too big. How do I change the size? What I have: (bitmap/url "http://www.example.com/") 回答1: Import this package: (require htdp/image) And use the shrink procedures defined in that package. EDIT : As has been pointed out in the comments, 2htdp/image would be a better alternative: (require 2htdp/image) Take a look at the scale procedure. 来源: https://stackoverflow.com/questions/10318208/how-to

How to transfer a file from url to ftp using java?

老子叫甜甜 提交于 2020-01-23 11:11:47
问题 Given a url, I want to transfer the file in that url to a specific to ftp. I have two options: 1) Using external library (like apache common-io) I can fetch the file from the url and then upload it to the ftp. 2) Open two sockets (to the url an to the ftp) and simply transfer the file from the url to the ftp. I'm I right about this? What's the best way to do that? I'm using spring. Here are some links that I found about it: How to download and save a file from Internet using Java?. Here is

图片集群分布式存储和负载均衡

一世执手 提交于 2020-01-23 10:23:03
今天记录下图片的分布式存储和负载均衡实现原理。 对于Web服务器而言,用户对图片信息的访问是很消耗服务器资源的。当一个网页被浏览时,Web服务器与浏览器建立连接,每个连接表示一个并发。当页面包含多个图片时,Web服务器与浏览器会产生多个连接,同时发送文字和图片以提高浏览速度。因此,页面中图片越多Web服务器受到的压力也就越大。 一般小型网站是把所有页面和图片统一存放在一个主目录下,这样的网站对系统架构、性能要求都很简单。下面是原理图 一些稍有规模的网站都保存有大量图片资源。用户在访问这些站点网页时,网页中图片信息占到页面数据流量的大部分。由于受客户端浏览器限制,无法从一台服务器上同时下载页面中所有图片信息,因此即使服务器有很高带宽,用户的访问速度还是会受到很大影响。由于图片保存在物理硬盘上,访问图片需要频繁进行I/O 操作,因此当并发用户数越来越多时,I/O操作就会成为整个系统的性能瓶颈。这个时候我们就要考虑把这些图片信息进行分布式存储了。 下面说一个适用于中等规模商务网站的图片数据分布式动态存储及负载均衡的解决方案的思路。这种思想只需增加很少的硬件成本,即可提升网站的访问速度,并且可以根据需要动态调整图片服务器的数量及图片的存储目录,确保系统具有可扩展性和伸缩性。但对于大型的网站系统来说,他们可能会有更好的技术来实现数据的分布式存储。 增加了图片服务器后,对于客户端而言

Forwarding slash in Wordpress URL

邮差的信 提交于 2020-01-23 05:45:07
问题 I am moving my site from Drupal to Wordpress. In Drupal, I can easily give an alias to URL and this alias could be anything., ie: www.example.com/abc/xyz/hello.html But in Wordpress, it appears that I cannot do that with WP out of the box. Any hint on how to do the same with Wordpress? I need to keep URL consistence. Thank you 回答1: I just found out this plugin https://wordpress.org/plugins/custom-permalinks/ and used it to add caracters like slashes and points, to the urls of a website i am

网络编程与反射

倖福魔咒の 提交于 2020-01-23 05:17:53
一、网络编程 1、UDP url:统一资源定位符 互联网的三大基石:html、http、url 协议:getProtocol() 域名:getHost() 端口:getPort() 得到锚点:getRef() URL url=new URL("https://www.taobao.com"); System.out.println(url); System.out.println("协议"+url.getProtocol()); System.out.println("端口"+url.getPort()); System.out.println("域名"+url.getHost()); System.out.println("查询内容"+url.getQuery()); System.out.println("锚点"+url.getRef()); 2、传输协议 TCP:面向连接,3次握手,安全但开销大,效率低,大小没有限制; UDP:非面向连接,不安全协议简单,开销小,效率高,只管发只管写,大小限制一般不超过60k; 面向Socket编程:传输层为应用层开辟的口子,用来传出数据 UDP对Socket实现: DatagramPacket: 打包|数据报包 DatagramPacket(byte[] buf, int offset, int length, SocketAddress