url

爬虫初学——爬取京东商品的评论(一)

╄→尐↘猪︶ㄣ 提交于 2020-03-05 13:21:05
最近,初学了一些爬虫的知识,然后刚好被老师要求去爬取一些评论数据(淘宝、京东等),来进行深度学习识别虚假评论。然后咋办咧,东搜搜西搜搜,看有没有什么好的办法。毕竟之前可是被反爬机制很强的网站弄得毫无头绪。 在此,主要感谢简书的两位博主的博客,让我能够入门。 1、第一位博主,给了一套非常浅显易懂的爬虫入门教程,原来爬虫基础可以这么简单,而且还更新了哦。 传送门 2、第二位博主,则是,让我找到了爬取京东评论的思绪。 传送门 一、获取评论所在的网页url 1、进入京东的某一个商品,找到评论处 : 2、右键——检查——Network: 3、点击左边网页评论中的“全部”评论 ,也就是刷新一下此处网页,这样network总就会显示请求的url了(最好点击一下js,这样不必看那么多繁琐的内容),下面得到了一个url: "4、open in new tab",可以打开浏览器查看此url内容: 你会发现想要的评论就在这里面,但是这是json实现的。只不过我不会解析json怎么办???我们想要的是数据,虽然对结构看不懂,只不过这文字可是连在一起的,看的见的文字,我们可以用正则表达式啊。 5、分析一下url ,我们想要的可不是这单页的10条评论,所以点击下一页这评论是怎么变得咧,通过对别多条url,我们可以得到结论: 例子: https://club.jd.com/comment

修改MOSS网站的URL访问地址

╄→гoц情女王★ 提交于 2020-03-05 13:17:09
前几天公司的一个客户要试用一下公司在SharePoint平台上面做的一个应用系统,公司有一个安装好的虚拟机,但是域名是一个虚拟的,客户说要把URL改成他们的名称。 上网搜索了一个,结合自己做了一个小实验,通过两步可以很好的实现。 1、打开【管理中心】-【操作】-【备用访问映射】,给原有的url添加一个备用的访问URL,就是给原来的url添加一个新的url。 2、在IIS中,给要修改url的网站添加一个主机标头,新的主机标头就是第一步中的新url,可以参考下图 来源: https://www.cnblogs.com/virusswb/archive/2009/08/14/1546230.html

js刷新页面和跳转

岁酱吖の 提交于 2020-03-05 12:50:39
javascript返回上一页: 1、返回上一页 history.go(-1); 返回上两个页面 history.go(-2); <a href="javascript:history.go(-1);">上一页</a> 2、history.back(). 3、window.history.forward() 返回下一页 4、window.history.go(返回第几页,也可以是url) 5、window.location.href=url; js刷新页面的几种方法: 1、history.go(0); 2、window.location.href=当前页面url; 3、location=location; 4、location.replace(location); 5、location.assign(location); 6、window.navigate(location); 7、document.URL=location.href 自动刷新页面的方法: 1、页面自动刷新:在<head>标签中加入 <meta http=-equiv="refresh" content="20">其中20指每隔20s刷新一次 2、页面自动跳转:在<head>标签中加入 <meta http=-equiv="refresh" content="20;url="http:www.baidu.com"

js获取url参数值

走远了吗. 提交于 2020-03-05 10:08:28
今天碰到要在一个页面获取另外一个页面url传过来的参数,一开始很本能的想到了用 split("?")这样一步步的分解出需要的参数。 后来想了一下,肯定会有更加简单的方法的!所以在网上找到了两个很又简单实用的方法,mark下 方法一:正则分析法 function getQueryString(name) { var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i"); var r = window.location.search.substr(1).match(reg); if (r != null) return unescape(r[2]); return null; } 这样调用: alert(GetQueryString("参数名1")); alert(GetQueryString("参数名2")); alert(GetQueryString("参数名3")); 方法二: <span style= "font-size: 16px;" ><Script language= "javascript" > function GetRequest() { var url = location.search; //获取url中"?"符后的字串 var theRequest = new Object(); if (url

mod_rewrite with name replacing ID

ε祈祈猫儿з 提交于 2020-03-05 09:46:34
问题 I have a page on my website that dynamically displays content. The URL structure is mywebsite.com/giveaway/giveaway.php?id=(any number) I wish to change that dynamic URL into a static/friendly URL mywebsite.com/giveaway/name-of-giveaway-corresponding-to-id . In my .htaccess file found in my root folder i have the following: RewriteEngine On # external redirect from actual URL to pretty one RewriteCond %{THE_REQUEST} \s/+\?page=([^\s&]+) [NC] RewriteRule ^ /page/%1? [R=301,L] # existing rule

JSP连接mysql数据库的重点

雨燕双飞 提交于 2020-03-05 07:14:13
1:用mysql驱动把mysql与tomcat的连接起来。把mysql驱动包(不用解压)放到Tomcat安装目录中lib文件夹下即可。 2:然后在自己的新建的web应用程序上面就可以下下面的代码 3:JDBC连接mysql数据库三步走 第一首先加载数据库驱动,注册到驱动管理器Class.forName("com.mysql.jdbc.Driver"); 第二构建数据库连接URL,String URL="jdbc:mysql://localhost:3306/test";//test为自己创建的数据库,url格式:"jdbc协议:ip地址或者域名+端口+数据库名称" 第三获取Connection对象 Connection conn=DriverManager.getConnection("root","123456",URL);//root为自己mysql的用户名,123456为自己mysql的密码 解释说明: String url="jdbc:mysql://localhost:3306/test";//test为自己创建的数据库 String username="root";//自己的mysql用户 String password="123456";//自己的mysql的密码 1 <%@ page language="java" contentType="text/html;

BOM属性对象方法

元气小坏坏 提交于 2020-03-05 07:06:05
location对象 location.href ----- 返回或设置当前文档的URL location.search ----- 返回URL中查询字符串部分,返回结果包括?以及?后的内容 location.hash ----- 返回URL中#以及后面的内容,如果没有#,则返回空 location.host ----- 返回URL中的域名部分 location.hostname ----- 返回URL中的主域名部分 location.pathname ----- 返回URL的域名后的部分 location.port ----- 返回URL中的端口部分 location.protocol ----- 返回URL中的协议部分 location.assign ----- 设置当前文档的URL location.replace(URL) ----- 设置当前文档的URL,并且在history对象的地址列表中移除这个URL location.reload() ----- 重载当前页面 history对象 history.go(num) ----- 前进或后退指定的页面数 history.back() ----- 后退一页 history.forward() ----- 前进一页 navigator对象 navigator,userAgent ----- 返回用户代理头的字符串表示

WordPress suddenly changed url addressing style from 'abc.net/home/… to abc.net/home-3/

核能气质少年 提交于 2020-03-05 06:05:32
问题 Please help with the issue on my WordPress site (I`ve Googled for nothing. My site has url structure "egf.ru/home/...", but suddenly all links become "egf.ru/home-3/.." It looks like the site decided to move permanently on his own will. I`m new to WordPress and failed to find out how to bring it back and what was the reason for that. The main trouble of this - SEO . Because now all previously valid indexed (egf.ru/home/... ) links become 404. And the next problem is that some articles still

WordPress suddenly changed url addressing style from 'abc.net/home/… to abc.net/home-3/

你。 提交于 2020-03-05 06:05:26
问题 Please help with the issue on my WordPress site (I`ve Googled for nothing. My site has url structure "egf.ru/home/...", but suddenly all links become "egf.ru/home-3/.." It looks like the site decided to move permanently on his own will. I`m new to WordPress and failed to find out how to bring it back and what was the reason for that. The main trouble of this - SEO . Because now all previously valid indexed (egf.ru/home/... ) links become 404. And the next problem is that some articles still

Moving Legacy .php url extensions to Laravel

扶醉桌前 提交于 2020-03-05 06:04:15
问题 Is it possible to add a .php extension to laravel routes like so: example.com/mypage.php I am transitioning an old website into Laravel but don't want to change the URL for SEO purposes. I notice there is a similar question that works for .html files in the routing web.php. i.e. Route::get('mypage.html', function () { return 'Hello World'; }); Which works fine but: Route::get('mypage.php', function () { return 'Hello World'; }); returns - No input file specified. Is there any way to resolve