导入包:

  <!-- https://mvnrepository.com/artifact/org.seleniumhq.selenium/selenium-firefox-driver --><dependency><groupId>org.seleniumhq.selenium</groupId><artifactId>selenium-firefox-driver</artifactId><version>3.141.59</version></dependency>

爬取(controller)

package com.qinpoint.controller;
import com.alibaba.fastjson.JSON;
import com.aliyun.oss.OSS;
import com.qinpoint.bo.XinTuBo;
import com.qinpoint.common.RestResponse;
import com.qinpoint.common.ResultUtil;
import com.qinpoint.constant.Constant;
import com.qinpoint.dto.ValuesDto;
import com.qinpoint.dto.XinTuDetails;
import com.qinpoint.dto.XinTuDto;
import com.qinpoint.service.IXinTuService;
import com.qinpoint.utils.AliYunOssClientUtil;
import com.qinpoint.utils.StringUtils;
import lombok.extern.slf4j.Slf4j;
import org.openqa.selenium.*;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.chrome.ChromeOptions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.imageio.ImageIO;
import javax.servlet.http.HttpServletRequest;
import java.awt.image.BufferedImage;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import java.util.concurrent.TimeUnit;import static com.qinpoint.utils.AliYunOssClientUtil.getImgUrl;
import static com.qinpoint.utils.OssClientConstants.BACKET_NAME;
import static com.qinpoint.utils.OssClientConstants.FOLDER;/*** @program: selenium* @description: 星图抓取* @author: wt* @create: 2020-08-10 16:58**/
@Slf4j
@RestController
@RequestMapping("/xintu/")
public class XinTuController {int a =  (int)Math.random()*10+1;/*** 随机数*/private final int RANDOM = a < 2 ? a+2 :a;/*** 抓取详情5分钟*/private final Long A_TIME =  RANDOM  * 60 * 1000L ;/*** 截图*/private final Long T_TIME = (RANDOM-2) * 60 *1000L;/*** 循环调取详情页面*/private final Long FOR_DE_TIME = StringUtils.getRandomInterval(30,60)*1L;@Autowiredprivate IXinTuService iXinTuService;/*** 爬虫爬取(http://localhost:58001/xintu/capture)* @param request* @return* @throws Exception*/@RequestMapping("capture")public RestResponse capture(HttpServletRequest request) throws Exception{Thread.sleep(3000);System.setProperty("webdriver.chrome.driver", "F:\\chromedriver.exe");ChromeOptions options = new ChromeOptions();options.addArguments("--test-type","--no-check-certificate","--ignore-certificate-errors","--start-maximized","--disable-extensions");WebDriver webDriver= new ChromeDriver(options);webDriver.manage().window().maximize();webDriver.manage().deleteAllCookies();// 与浏览器同步非常重要,必须等待浏览器加载完毕webDriver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);//打开目标地址webDriver.get("https://star.toutiao.com/login?roleType=user");//输入账号 密码并登陆系统webDriver.findElement(By.xpath("/html/body/div/div/div[2]/div[2]/div/div/div[2]/div[2]/div[1]")).click();Thread.sleep(1000);webDriver.findElement(By.name("email")).sendKeys("******");webDriver.findElement(By.xpath("//*[@id=\"account-sdk\"]/section/div[3]/div[2]/div/div/input")).sendKeys("*****");webDriver.findElement(By.xpath("//*[@id=\"account-sdk\"]/section/div[6]/button")).click();//选择系统Thread.sleep(1*60*1000);//抖音达人webDriver.findElement(By.xpath("/html/body/div[1]/div[1]/div[2]/div[1]/div[1]/div/div[2]/div[2]/div[1]/div[2]/div[1]/span")).click();Set<Cookie> cookies = webDriver.manage().getCookies();List<String> cookieList = new ArrayList<>();for (Cookie ck : cookies){cookieList.add(ck.getName() + "=" + ck.getValue());}int a = 1;XinTuBo xinTuBo= new XinTuBo();xinTuBo.setRedisKey("car");
//        List<XinTuDto> car = this.iXinTuService.findXinTuSortRedis(xinTuBo);
//        for (XinTuDto xinTuDto : car) {
//            log.error("car  " + a++ );
//            Thread.sleep(FOR_DE_TIME);
//            getXinTuDetail(xinTuDto.getId(), Constant.CAR_REDIS,webDriver);
//        }//        xinTuBo.setRedisKey("game");
//        List<XinTuDto> game = this.iXinTuService.findXinTuSortRedis(xinTuBo);
//        for (XinTuDto xinTuDto : game) {
//            Thread.sleep(FOR_DE_TIME);
//            log.error("game  " + a++ );
//            getXinTuDetail(xinTuDto.getId(), Constant.GAME_REDIS,webDriver);
//        }//        xinTuBo.setRedisKey("infant");
//        List<XinTuDto> infant = this.iXinTuService.findXinTuSortRedis(xinTuBo);
//        for (XinTuDto xinTuDto : infant) {
//            log.error("infant  " + a++ );
//                Thread.sleep(FOR_DE_TIME);
//                getXinTuDetail(xinTuDto.getId(), Constant.INFANT_REDIS,webDriver);
//        }//        xinTuBo.setRedisKey("plot");
//        List<XinTuDto> plot = this.iXinTuService.findXinTuSortRedis(xinTuBo);
//        log.error("plot " + plot.size());
//        for (XinTuDto xinTuDto : plot) {
//            log.error("plot  " + a++ );
//            Thread.sleep(FOR_DE_TIME);
//            getXinTuDetail(xinTuDto.getId(), Constant.PLOT_REDIS,webDriver);
//        }/*** 抓取列表*/iXinTuService.addXinTuSortCookie(cookieList);return ResultUtil.success();}/*** 获取详情页信息* @param id* @param webDriver* @return*/private XinTuDetails getXinTuDetail(String id ,String redisKey,WebDriver webDriver){XinTuDetails  xinTuDetails = new XinTuDetails();try {String plot_url = "https://star.toutiao.com/ad#/author/douyin/"+id+"/1/?recommend=false";webDriver.get(plot_url);webDriver.navigate().refresh();webDriver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);log.error("id = "  +  id);Thread.sleep(A_TIME);List<ValuesDto> values = new ArrayList<>();WebElement valuel = webDriver.findElement(By.xpath("//div[@class=\"star-row\"][1]//div[@class=\"male gender-item\"]"));ValuesDto v1=  new ValuesDto();v1.setName(valuel.findElement(By.className("name")).getText());v1.setValue(valuel.findElement(By.className("value")).getText());log.error("v1.name " + v1.getName() +","+ "v1.value " + v1.getValue());WebElement value2 = webDriver.findElement(By.xpath("//div[@class=\"star-row\"][1]//div[@class=\"female gender-item\"]"));ValuesDto v2 =  new ValuesDto();v2.setName(value2.findElement(By.className("name")).getText());v2.setValue(value2.findElement(By.className("value")).getText());log.error("v2.name " + v2.getName() + "," +"v2.getValue() =" + v2.getValue());values.add(v1);values.add(v2);xinTuDetails.setMaxVideoPlay(webDriver.findElement(By.xpath("//*[@id=\"pane-play\"]/div[1]/span[2]/strong")).getText());xinTuDetails.setMinVideoPlay(webDriver.findElement(By.xpath("//*[@id=\"pane-play\"]/div[1]/span[1]/strong")).getText());xinTuDetails.setValuesDtos(values);WebElement bfa = webDriver.findElement(By.xpath("//div[@class=\"indicator-card\"][1]//div[@class=\"value\"]"));xinTuDetails.setVideoFinishPlay(bfa.getText());String bf_url = this.getBoFangImageUrl(webDriver);log.info("bf_url" + bf_url);String fs_url = this.getFenSiImageUrl(webDriver);log.info("fs_url" + fs_url);xinTuDetails.setBfUrl(bf_url);xinTuDetails.setFsUrl(fs_url);
//            xinTuDetails.setBfNum(Sample.getImageSite(fs_url));xinTuDetails.setDtUrl(plot_url);this.iXinTuService.addXinTuSortRedis(redisKey + ":" + id, JSON.toJSONString(xinTuDetails));}catch (Exception e){log.error(e.getMessage());}return xinTuDetails;}/*** 获取粉丝图片* @param webDriver* @return*/private String getFenSiImageUrl(WebDriver webDriver){String url = null;try {Thread.sleep(T_TIME);WebElement e = webDriver.findElement(By.xpath("//div[@class=\"card-panel section-container\"]"));log.info("scroll view element");JavascriptExecutor js = (JavascriptExecutor) webDriver;// roll down and keep the element to the center of browserjs.executeScript("arguments[0].scrollIntoView(true);", e);File files = ((TakesScreenshot) webDriver).getScreenshotAs(OutputType.FILE);Point p = e.getLocation();int width = e.getSize().getWidth();BufferedImage subImage = ImageIO.read(files).getSubimage(p.getX()+100 , p.getY() , width+250, 600);ImageIO.write(subImage, "png", files);OSS ossClient = AliYunOssClientUtil.getOSSClient();AliYunOssClientUtil.uploadObject2OSS(ossClient, files, BACKET_NAME, FOLDER);url = getImgUrl(files.getName()).split(files.getName())[0] + files.getName();} catch (Exception e) {e.printStackTrace();}return url;}/*** 获取播放量图片* url = http://qduploadimage.oss-cn-beijing.aliyuncs.com/seleniumImage/screenshot8062161595485560820.png* @param webDriver* @return*/private String getBoFangImageUrl(WebDriver webDriver){String url = null;try {Thread.sleep(T_TIME);WebElement e = webDriver.findElement(By.xpath("//div[@class=\"content-wrapper data-trend-section\"]"));log.info("scroll view element");JavascriptExecutor js = (JavascriptExecutor) webDriver;// roll down and keep the element to the center of browserjs.executeScript("arguments[0].scrollIntoView(true);", e);File files = ((TakesScreenshot) webDriver).getScreenshotAs(OutputType.FILE);Point p = e.getLocation();int width = e.getSize().getWidth();BufferedImage subImage = ImageIO.read(files).getSubimage(p.getX()+100 , p.getY()+100 , width+250, 500);ImageIO.write(subImage, "png", files);OSS ossClient = AliYunOssClientUtil.getOSSClient();AliYunOssClientUtil.uploadObject2OSS(ossClient, files, BACKET_NAME, FOLDER);url = getImgUrl(files.getName()).split(files.getName())[0] + files.getName();} catch (Exception e) {e.printStackTrace();}return url;}}

service

package com.qinpoint.service;import com.alibaba.fastjson.JSONObject;
import com.qinpoint.bo.XinTuBo;
import com.qinpoint.dto.XinTuDetails;
import com.qinpoint.dto.XinTuDto;import java.util.List;/*** @author wt* 星图数据*/
public interface IXinTuService {/*** 添加数据,传递cookie* @param cookieList cookie* @return*/boolean addXinTuSortCookie(List<String> cookieList);/*** 添加全部* @param cookieList* @return*/boolean addAll(List<String> cookieList);/*** 剧情搞笑添加* @param cookieList* @return*/boolean addPlot(List<String> cookieList);/*** 添加游戏* @param cookieList* @return*/boolean addGame(List<String> cookieList);/*** 母婴亲子* @param cookieList* @return*/boolean addInfant(List<String> cookieList);/*** 汽车* @param cookieList* @return*/boolean addCar(List<String> cookieList);/*** 添加* @param url 地址* @param cookieList cookie* @return*/JSONObject addXinTuSortDate(String url, List<String> cookieList);/*** 获取星图数据* @param xinTuBo* @return*/List<XinTuDto> findXinTuSortRedis(XinTuBo xinTuBo);/*** 添加缓存* @param key* @param value* @return*/boolean addXinTuSortRedis(String key,String value);/*** 获取详情* @param key* @return*/XinTuDetails getXinTuDetails(String key);
}

实现类:

package com.qinpoint.service.impl;import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.qinpoint.bo.XinTuBo;
import com.qinpoint.common.CalculateUtils;
import com.qinpoint.constant.Constant;
import com.qinpoint.dto.XinTuDetails;
import com.qinpoint.dto.XinTuDto;
import com.qinpoint.dto.XinTuPriceDto;
import com.qinpoint.service.IXinTuService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
import org.springframework.web.client.RestTemplate;
import java.util.ArrayList;
import java.util.List;
/*** @program: selenium* @description: 星图数据抓取* @author: wt* @create: 2020-08-12 09:15**/
@Slf4j
@Service
public class XinTuServiceImpl implements IXinTuService {int a =  (int)Math.random()*10+1;/*** 随机数*/private final int RANDOM = a < 2 ? a+2 :a;/*** 抓取列表*/private final Long FOR_LIST =  RANDOM  * 60 * 1000L ;@Autowiredprivate StringRedisTemplate stringRedisTemplate;@Autowiredprivate RestTemplate restTemplate;@Overridepublic boolean addXinTuSortCookie(List<String> cookieList) {
//        this.addPlot(cookieList);this.addGame(cookieList);
//        this.addInfant(cookieList);
//        this.addCar(cookieList);
//        this.addAll(cookieList);return true;}@Overridepublic boolean addAll(List<String> cookieList) {String plot_url = "https://star.toutiao.com/v/api/demand/author_list/?limit="+ 30+ "&need_detail=true&page=1&platform_source=1&task_category=1&order_by=score&disable_replace_keyword=false&is_author_plan=false&is_filter=true";JSONObject json = addXinTuSortDate(plot_url, cookieList);this.addXinTuSortRedis(Constant.XIN_TU_SORT + "a_url",json.toJSONString());return false;}@Overridepublic boolean addPlot(List<String> cookieList) {String plot_url = "https://star.toutiao.com/v/api/demand/author_list/?limit=30&need_detail=true&page=1&platform_source=1&task_category=1&tag=97&order_by=score&disable_replace_keyword=false&is_author_plan=false&expected_cpm__le=50&is_filter=true";List<XinTuDto> all = new ArrayList<>();JSONObject json = addXinTuSortDate(plot_url, cookieList);List<XinTuDto> onext = analysisXtJSON(json);Long total = totalCount(json);Integer num = CalculateUtils.getCountTotalPage(total, 30);log.error( "num" + num);all.addAll(onext);for (int i = 2; i < num ; i++) {log.error("plot i = " + i);try {Thread.sleep(FOR_LIST);} catch (InterruptedException e) {e.printStackTrace();}String plot = "https://star.toutiao.com/v/api/demand/author_list/?limit="+ 30+ "&need_detail=true&page="+i+"&platform_source=1&task_category=1&order_by=score&disable_replace_keyword=false&is_author_plan=false&is_filter=true";JSONObject object = addXinTuSortDate(plot, cookieList);log.error("addPlot object " + object.isEmpty());all.addAll(analysisXtJSON(object));}this.addXinTuSortRedis(Constant.PLOT_REDIS,JSON.toJSONString(all));return true;}@Overridepublic boolean addGame(List<String> cookieList) {String plot_url = "https://star.toutiao.com/v/api/demand/author_list/?limit=20&need_detail=true&page=1&platform_source=1&task_category=1&tag=23&order_by=score&disable_replace_keyword=false&is_author_plan=false&expected_cpm__le=50&is_filter=true";List<XinTuDto> all = new ArrayList<>();JSONObject json = addXinTuSortDate(plot_url, cookieList);List<XinTuDto> onext = analysisXtJSON(json);Long total = totalCount(json);Integer num = CalculateUtils.getCountTotalPage(total, 20);log.error( "num" + num);all.addAll(onext);for (int i = 2; i < num ; i++) {log.error("i = " + i);try {Thread.sleep(FOR_LIST);} catch (InterruptedException e) {e.printStackTrace();}String plot = "https://star.toutiao.com/v/api/demand/author_list/?limit=20&need_detail=true&page="+i+"&platform_source=1&task_category=1&tag=23&order_by=score&disable_replace_keyword=false&is_author_plan=false&expected_cpm__le=50&is_filter=true";JSONObject object = addXinTuSortDate(plot, cookieList);log.error("addGame object " + object.isEmpty());all.addAll(analysisXtJSON(object));}this.addXinTuSortRedis(Constant.GAME_REDIS,JSON.toJSONString(all));return true;}@Overridepublic boolean addInfant(List<String> cookieList) {String plot_url = "https://star.toutiao.com/v/api/demand/author_list/?limit=20&need_detail=true&page=1&platform_source=1&task_category=1&tag=55&order_by=score&disable_replace_keyword=false&is_author_plan=false&expected_cpm__le=50&is_filter=true";List<XinTuDto> all = new ArrayList<>();JSONObject json = addXinTuSortDate(plot_url, cookieList);List<XinTuDto> onext = analysisXtJSON(json);Long total = totalCount(json);all.addAll(onext);Integer num = CalculateUtils.getCountTotalPage(total, 20);log.error( "num" + num);for (int i = 2; i < num ; i++) {log.error("i = " + i);try {Thread.sleep(FOR_LIST);} catch (InterruptedException e) {e.printStackTrace();}String plot = "https://star.toutiao.com/v/api/demand/author_list/?limit=20&need_detail=true&page="+i+"&platform_source=1&task_category=1&tag=55&order_by=score&disable_replace_keyword=false&is_author_plan=false&expected_cpm__le=50&is_filter=true";JSONObject object = addXinTuSortDate(plot, cookieList);log.error("addInfant object " + object.isEmpty());all.addAll(analysisXtJSON(object));}this.addXinTuSortRedis(Constant.INFANT_REDIS,JSON.toJSONString(all));return true;}@Overridepublic boolean addCar(List<String> cookieList) {String plot_url = "https://star.toutiao.com/v/api/demand/author_list/?limit=20&need_detail=true&page=1&platform_source=1&task_category=1&tag=31&order_by=score&disable_replace_keyword=false&is_author_plan=false&expected_cpm__le=50&is_filter=true";List<XinTuDto> all = new ArrayList<>();JSONObject json = addXinTuSortDate(plot_url, cookieList);List<XinTuDto> onext = analysisXtJSON(json);Long total = totalCount(json);Integer num = CalculateUtils.getCountTotalPage(total, 20);all.addAll(onext);log.error( "num" + num);for (int i = 2; i < num ; i++) {log.error("car i = " + i);try {Thread.sleep(FOR_LIST);} catch (InterruptedException e) {e.printStackTrace();}String plot = "https://star.toutiao.com/v/api/demand/author_list/?limit=20&need_detail=true&page="+i+"&platform_source=1&task_category=1&tag=31&order_by=score&disable_replace_keyword=false&is_author_plan=false&expected_cpm__le=50&is_filter=true";JSONObject object = addXinTuSortDate(plot, cookieList);log.error("addCar object " + object.isEmpty());all.addAll(analysisXtJSON(object));}this.addXinTuSortRedis(Constant.CAR_REDIS,JSON.toJSONString(all));return true;}@Overridepublic JSONObject addXinTuSortDate(String url, List<String> cookieList) {HttpHeaders requestHeaders = new HttpHeaders();requestHeaders.put("Cookie", cookieList);HttpEntity<String> requestEntity = new HttpEntity<>(null, requestHeaders);ResponseEntity<JSONObject> response = restTemplate.exchange(url, HttpMethod.GET, requestEntity, JSONObject.class);return response.getBody();}@Overridepublic List<XinTuDto> findXinTuSortRedis(XinTuBo xinTuBo) {String redisValue = stringRedisTemplate.opsForValue().get(Constant.XIN_TU_SORT + xinTuBo.getRedisKey());if (StringUtils.isEmpty(redisValue)){return null;}return JSONObject.parseArray(redisValue,XinTuDto.class);}@Overridepublic boolean addXinTuSortRedis(String key, String value) {String forValue = stringRedisTemplate.opsForValue().get(key);if (com.qinpoint.utils.StringUtils.isNotEmpty(forValue)){stringRedisTemplate.delete(key);}stringRedisTemplate.opsForValue().set(key,value);return true;}@Overridepublic XinTuDetails getXinTuDetails(String key) {String redisValue = stringRedisTemplate.opsForValue().get(Constant.XIN_TU_SORT + key);if (StringUtils.isEmpty(redisValue)){return  null;}return JSONObject.parseObject(redisValue,XinTuDetails.class);}/*** 进行 redis 存储json 解析* @param jsonObject* @return*/private List<XinTuDto>  analysisXtJSON(JSONObject jsonObject){List<XinTuDto> result = new ArrayList<>();JSONObject data = jsonObject.getJSONObject("data");if (!StringUtils.isEmpty(data)){JSONArray authors = data.getJSONArray("authors");for (Object author : authors) {XinTuDto dto = new XinTuDto();JSONObject user = JSONObject.parseObject(JSON.toJSONString(author));dto.setNick_name(user.getString("nick_name"));dto.setAvatar_uri(user.getString("avatar_uri"));dto.setFollower(user.getInteger("follower"));dto.setExpected_play_num(user.getInteger("expected_play_num"));dto.setExpected_cpm(user.getDouble("expected_cpm"));dto.setId(user.getString("id"));dto.setShort_id(String.valueOf(user.get("short_id")));List<XinTuPriceDto> priceDtoList = new ArrayList<XinTuPriceDto>();JSONArray priceInfoArray = user.getJSONArray("price_info");for (Object o : priceInfoArray) {XinTuPriceDto xinTuPriceDto = new XinTuPriceDto();JSONObject priceInfo = JSONObject.parseObject(JSON.toJSONString(o));xinTuPriceDto.setDesc(priceInfo.getString("desc"));xinTuPriceDto.setPrice(priceInfo.getInteger("price"));xinTuPriceDto.setSettlement_desc(priceInfo.getString("settlement_desc"));priceDtoList.add(xinTuPriceDto);}dto.setXinTuPriceDtos(priceDtoList);result.add(dto);}}return  result;}/*** 进行 redis 存储json 解析* @param jsonObject* @return*/private Long totalCount(JSONObject jsonObject){JSONObject data = jsonObject.getJSONObject("data");JSONObject pagination = data.getJSONObject("pagination");Integer total_count = pagination.getInteger("total_count");return   Long.parseLong(String.valueOf(total_count));}
}

实体类与图片上传 可以根据自己需求进行实现

Java selenium 爬取 星图相关推荐

  1. Java+Selenium爬取JavaScript返回的网页数据

    案例:本文主要描述如何根据快递单号使用Java+Selenium爬取"爱查快递网页"快递的跟踪信息并按照设计的数据格式返回数据 解决问题:爬取JavaScript返回的网页数据(网 ...

  2. java+selenium爬取知网数据

    使用selenium工具爬取知网相关数据,思路:根据几个关键词搜索出相关的内容,然后爬取列表中所有论文的访问链接. 注意:直接爬取的链接是不能用的,需要自己拼接一下.具体看代码.新手,代码写的有点乱. ...

  3. 基于Java + selenium 爬取某网站千张图片

    预览(可以根据循环次数爬取大量图片) 一.网页分析 1 点击F12进入检查,将小箭头移到网页中随便一张图片上 2 进一步我们可以发现每一张图片的链接都包含在<ul>标签的子标签<li ...

  4. java 动态爬虫_用selenium(Java)爬取b站up的动态

    新人第一次发文,请多多指教. selenium设计目的是进行自动化测试,但是很显然这样的功能同样是爬虫所需要的.本文介绍如何用selenium爬取b站up动态. 无意中发现有很多up在动态中发布一些奇 ...

  5. Selenium爬取网易云音乐评论

    Selenium爬取网易云音乐评论 一.爬取工具 1.1 selenium ​ selenium这是一个第三方库我们可以通过 pip install selenium来安装这个第三方库. ​ Sele ...

  6. 爬虫之selenium爬取斗鱼网站

    爬虫之selenium爬取斗鱼网站 示例代码: from selenium import webdriver import timeclass Douyu(object):def __init__(s ...

  7. python java 爬数据_如何用java爬虫爬取网页上的数据

    当我们使用浏览器处理网页的时候,有时候是不需要浏览的,例如使用PhantomJS适用于无头浏览器,进行爬取网页数据操作.最近在进行java爬虫学习的小伙伴们有没有想过如何爬取js生成的网络页面吗?别急 ...

  8. Php使用selenium爬虫,selenium,python爬虫_使用selenium爬取网站时输出结果不正确,selenium,python爬虫 - phpStudy...

    使用selenium爬取网站时输出结果不正确 网站链接:http://www.ncbi.nlm.nih.gov/pubmed?term=(%222013%22%5BDate%20-%20Publica ...

  9. [Python3网络爬虫开发实战] 7-动态渲染页面爬取-4-使用Selenium爬取淘宝商品

    在前一章中,我们已经成功尝试分析Ajax来抓取相关数据,但是并不是所有页面都可以通过分析Ajax来完成抓取.比如,淘宝,它的整个页面数据确实也是通过Ajax获取的,但是这些Ajax接口参数比较复杂,可 ...

最新文章

  1. Android开发实践:如何设置NDK的编译选项
  2. vim grep配置及使用
  3. 复习--linux目录及文件操作
  4. linux修改文件没有备份,归档模式,恢复没有备份的数据文件
  5. 如何使用 backupninja 来备份 Debian 系统
  6. Java学习笔记17(面向对象十:综合案例)
  7. 黑客编程入门 之 网络编程入门
  8. DNS服务器安装(linux)
  9. android 开发笔记 (黎活明)
  10. Nacos搭建集群以及遇到的问题
  11. openstack rally安装失败后折腾一遭
  12. java3大器_阿里祭出大器,Java代码检查插件
  13. 百度蜘蛛index.php,百度蜘蛛抓的这些404链接,不知道啥链接
  14. 如何使用cad版本转换器?转换cad版本的技巧
  15. 什么是线程池以及线程池的好处
  16. 制造业数字化转型和精益生产什么关系
  17. Android自定义拍照解决部分手机拍完之后图片不清楚的问题
  18. mysql 自增_mysql自增
  19. strongswan libstrongswan scheduler,processor,job,event和thread之间的关系
  20. Processing 入门教程(三十七)图层动画

热门文章

  1. 网络安全渗透技术(入门视频课程)-李云鹏-专题视频课程
  2. 5.内网渗透之PTHPTTPTK
  3. php pack ode,Python中的数值ODE求解
  4. 服务器主板信息花屏,清空BIOS设置,造成花屏问题的解决
  5. wpsa4排版_wps排版(wps如何一键排版)
  6. Miles per gallon to kilometers per liter
  7. threejs使用tweenjs实现点击标签过渡到相应视角
  8. CTFshow-萌新 Writeup
  9. background-position进行图片定位
  10. Windows文件夹中文名称英文路径