HtmlUnit(Java) - 快速入门学习 - 无界面浏览器

article/2025/10/14 22:49:57

文章目录

    • 1. 概述
    • 2. 注意
      • 2.0 js解析问题
      • 2.1 关闭HtmlUnit日志
    • 3. 使用
      • 3.1 抓取IT之家周榜内容 - 单页面
      • 3.2 抓取IT之家周榜第九篇文章的内容 - 双页面
      • 3.3 模拟用户操作 - (这个功能个人感觉非常非常的鸡肋,只能用于非常简单的JS,但是一般网站的动作触发都会进行一系列复杂的JS操作,所以想爬虫还是推荐Selenium)
      • 3.4 文件下载
      • 3.5 弹框处理

注意: 对于百度翻译、百度搜索、腾讯翻译等页面依然抓取不了结果,对于加密的JS文件解析基本不生效 — 推荐使用Selenium爬复杂JS、以及加密JS页面的内容

1. 概述

官方文档: https://htmlunit.sourceforge.io/

有具体Demo的讲解文档(搭配官方文档效果更佳):https://www.scrapingbee.com/java-webscraping-book/

作用: 一个"用于Java程序的无GUI浏览器"。它对HTML文档进行建模,并提供一个API,允许您调用页面,填写表单,单击链接等…就像您在"正常"浏览器中所做的那样

2. 注意

2.0 js解析问题

根据官方文档描述,仅能解析js库: htmx, jQuery, jQuery, MochiKit, GWT, Sarissa, MooTools, Prototype, Ext, Dojo, Dojo, YUI所以遇到经过加密的JS文件、以及其他库很可能会解析失败 === 所以模拟抓百度翻译、腾讯翻译、有道翻译这些加密的JS抓不了,建议使用Selenium(Java)进行抓,不过这工具比较重,好用是非常好用、直接爬就完事压根就不用分析浏览器的请求

在这里插入图片描述

2.1 关闭HtmlUnit日志

java.util.logging.Logger.getLogger("com.gargoylesoftware").setLevel(Level.OFF);

3. 使用

依赖: https://search.maven.org/artifact/net.sourceforge.htmlunit/htmlunit

<dependency><groupId>net.sourceforge.htmlunit</groupId><artifactId>htmlunit</artifactId><version>2.58.0</version>
</dependency>

3.1 抓取IT之家周榜内容 - 单页面

在这里插入图片描述

抓取IT之家周榜的内容

    /*** IT之家*/@Test@SneakyThrowspublic void test10() {//浏览器设置WebClient webClient = new WebClient();webClient.setAjaxController(new NicelyResynchronizingAjaxController());webClient.getOptions().setThrowExceptionOnFailingStatusCode(false);webClient.getOptions().setThrowExceptionOnScriptError(false);webClient.getOptions().setCssEnabled(true);webClient.getOptions().setJavaScriptEnabled(true);webClient.getOptions().setActiveXNative(false);//打开页面HtmlPage page = webClient.getPage("https://www.ithome.com/");//鼠标悬浮到周榜上DomElement inputEle = page.getFirstByXPath("//div[@id='rank']//li[@data-id='2']");page = (HtmlPage) inputEle.mouseOver();DomElement ulElement = page.getFirstByXPath("//div[@id='rank']//ul[@id='d-2']");//周榜信息System.out.println(ulElement.asNormalizedText());}


抓取成功
在这里插入图片描述

3.2 抓取IT之家周榜第九篇文章的内容 - 双页面

在这里插入图片描述

在这里插入图片描述


    /*** IT之家周榜第九篇内容*/@Test@SneakyThrowspublic void test11() {WebClient webClient = new WebClient();webClient.setAjaxController(new NicelyResynchronizingAjaxController());webClient.getOptions().setThrowExceptionOnFailingStatusCode(false);webClient.getOptions().setThrowExceptionOnScriptError(false);webClient.getOptions().setCssEnabled(true);webClient.getOptions().setJavaScriptEnabled(true);webClient.getOptions().setActiveXNative(false);HtmlPage page = webClient.getPage("https://www.ithome.com/");//鼠标悬浮到周榜上DomElement inputEle = page.getFirstByXPath("//div[@id='rank']//li[@data-id='2']");page = (HtmlPage) inputEle.mouseOver();//获取文章链接List<DomElement> articleLinkElems = page.getByXPath("//div[@id='rank']//ul[@id='d-2']//a");if(CollUtil.isNotEmpty(articleLinkElems)) {//第九篇文章page = articleLinkElems.get(8).click();DomElement articleDivElem = page.getFirstByXPath("//div[@id='dt']//div[@class='fl content']");System.out.println(articleDivElem.asNormalizedText());}}


抓取成功
在这里插入图片描述

3.3 模拟用户操作 - (这个功能个人感觉非常非常的鸡肋,只能用于非常简单的JS,但是一般网站的动作触发都会进行一系列复杂的JS操作,所以想爬虫还是推荐Selenium)

示例页面

<!DOCTYPE html>
<html lang="en"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>HtmlUnit测试</title>
</head><body><form id="form" onclick="return false;"><div class="container"><input type="hidden" placeholder="Enter Username" name="mark" id="mark" required value="ajax手动提交"><label for="uname"><b>账号</b></label><input type="text" placeholder="Enter Username" name="uname" id="uname" required><label for="psw"><b>密码</b></label><input type="password" placeholder="Enter Password" name="psw"  id="psw" required><button id="loginBtn" type="button">登陆</button></div></form><form id="form2" method="post" action="http://127.0.0.1:8080/login"><div class="container"><input type="hidden" placeholder="Enter Username" name="mark" id="mark2" required value="form表单提交"><label for="uname"><b>账号2</b></label><input type="text" placeholder="Enter Username" name="uname" id="uname2" required><label for="psw"><b>密码2</b></label><input type="password" placeholder="Enter Password" name="psw"  id="psw2" required><button id="loginBtn2" type="submit">登陆2</button></div></form></body><script src="file:///G:/VsCode/开源/jquery-3.5.1/jquery-3.5.1.min.js"></script>
<script>$(function () {//登陆function loginOperation() {$.post("http://127.0.0.1:8080/login",$("#form").serialize(),responseData => {$("body").append(`<h1>${JSON.stringify(responseData)}</h1>`)$("form").hide();},"json")return false;}$("#loginBtn").click(loginOperation);})
</script></html>


登录接口代码 == springboot == 注意下面是两个文件的代码

@Configuration
public class SystemConfig {//允许跨域@Beanpublic CorsFilter corsFilter() {CorsConfiguration corsConfiguration = new CorsConfiguration();corsConfiguration.addAllowedOriginPattern("*");corsConfiguration.setAllowCredentials(true);corsConfiguration.addAllowedMethod("*");corsConfiguration.addAllowedHeader("*");UrlBasedCorsConfigurationSource configSource = new UrlBasedCorsConfigurationSource();configSource.registerCorsConfiguration("/**", corsConfiguration);return new CorsFilter(configSource);}
}@Controller
@RequestMapping
@ResponseBody
public class LoginController {@PostMapping("login")public Map login(HttpServletRequest request) {Map parameterMap = new HashMap(request.getParameterMap());parameterMap.put("name", "嗯嗯*");return parameterMap;}}

在这里插入图片描述


模拟用户表单操作

    /*** 模拟用户输入*/@Test@SneakyThrowspublic void test12() {WebClient webClient = new WebClient();webClient.setAjaxController(new NicelyResynchronizingAjaxController());webClient.getOptions().setThrowExceptionOnFailingStatusCode(false);webClient.getOptions().setThrowExceptionOnScriptError(false);webClient.getOptions().setCssEnabled(true);webClient.getOptions().setJavaScriptEnabled(true);webClient.getOptions().setActiveXNative(false);//ajax手动提交的请求HtmlPage page = webClient.getPage("file:///C:/Users/Administrator/Desktop/index5.html");DomElement loginNameElem = page.getElementById("uname");loginNameElem.setAttribute("value", "root");DomElement passwordElem = page.getElementById("psw");passwordElem.setAttribute("value", "pswroot");//提交form1的表单DomElement startLoginBtnElem = page.getElementById("loginBtn");page = startLoginBtnElem.click();DomElement userInfoDivElem = page.getFirstByXPath("//h1");System.out.println(userInfoDivElem.asNormalizedText());//==================================================//表单提交 == 返回的是JSON结果的页面,不是htmlPage页面故需要将结果转成UnexpectedPagepage = webClient.getPage("file:///C:/Users/Administrator/Desktop/index5.html");HtmlInput inputloginNameElem = (HtmlInput) page.getElementById("uname2");inputloginNameElem.setAttribute("value", "root2");HtmlInput inputpasswordElem = (HtmlInput) page.getElementById("psw2");inputpasswordElem.setAttribute("value", "pswroot2");//提交form2的表单HtmlForm enclosingForm = inputloginNameElem.getEnclosingForm();UnexpectedPage page2 = webClient.getPage(enclosingForm.getWebRequest(null));//获取响应结果System.out.println(page2.getWebResponse().getContentAsString(UTF_8));}

在这里插入图片描述

3.4 文件下载

<!DOCTYPE html>
<html lang="en"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>HtmlUnit测试</title></head><body><form id="form" onclick="return false;"><div class="container"><input type="hidden" placeholder="Enter Username" name="mark" id="mark" required value="ajax手动提交"><label for="uname"><b>账号</b></label><input type="text" placeholder="Enter Username" name="uname" id="uname" required><label for="psw"><b>密码</b></label><input type="password" placeholder="Enter Password" name="psw" id="psw" required><button id="loginBtn" type="button">登陆</button></div></form><form id="form2" method="post" action="http://127.0.0.1:8080/login"><div class="container"><input type="hidden" placeholder="Enter Username" name="mark" id="mark2" required value="form表单提交"><label for="uname"><b>账号2</b></label><input type="text" placeholder="Enter Username" name="uname" id="uname2" required><label for="psw"><b>密码2</b></label><input type="password" placeholder="Enter Password" name="psw" id="psw2" required><button id="loginBtn2" type="submit">登陆2</button></div></form><a href="http://127.0.0.1:8080/download" id="downloadBtn">下载按钮(当前页面)</a><br/><a href="http://127.0.0.1:8080/download" id="downloadBtn2" target="_blank">下载按钮2(新页面)</a></body><script src="file:///G:/VsCode/开源/jquery-3.5.1/jquery-3.5.1.min.js"></script><script>$(function() {//登陆function loginOperation() {$.post("http://127.0.0.1:8080/login", $("#form").serialize(), responseData => {$("body").append(`<h1>${JSON.stringify(responseData)}</h1>`)$("form").hide();}, "json")return false;}$("#loginBtn").click(loginOperation);})</script></html>

在这里插入图片描述


文件下载接口

package work.linruchang.qq.htmlunitweb.controller;import cn.hutool.core.util.StrUtil;
import lombok.SneakyThrows;
import org.springframework.core.io.FileSystemResource;
import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.net.URLEncoder;
import java.util.HashMap;
import java.util.Map;/*** 作用:** @author LinRuChang* @version 1.0* @date 2022/02/09* @since 1.8**/
@Controller
@RequestMapping
@ResponseBody
public class HtmlUnitController {/*** 下载文件测试* http://127.0.0.1:8080/download* @param request* @param httpServletResponse* @return*/@GetMapping("download")@SneakyThrowspublic ResponseEntity login(HttpServletRequest request, HttpServletResponse httpServletResponse) {System.out.println(request.getSession().getId() + "开始下载");FileSystemResource fileSystemResource = new FileSystemResource("E:\\微信\\文件\\WeChat Files\\wxid_n7xzf77wr3wv22\\FileStorage\\File\\2022-02\\房东符金瑞名下楼栋需要批量处理.xlsx");HttpHeaders headers = new HttpHeaders();headers.add("Cache-Control", "no-cache, no-store, must-revalidate");headers.add("Content-Disposition", StrUtil.format("attachment; filename={}", URLEncoder.encode(fileSystemResource.getFilename())));headers.add("Pragma", "no-cache");headers.add("Expires", "0");return ResponseEntity.ok().headers(headers).contentLength(fileSystemResource.contentLength()).contentType(MediaType.parseMediaType("application/octet-stream")).body(fileSystemResource);}}


开始测试HtmlUnit下载功能

package work.linruchang.qq;import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.io.IoUtil;
import cn.hutool.core.lang.Console;
import com.gargoylesoftware.htmlunit.*;
import com.gargoylesoftware.htmlunit.html.*;
import com.gargoylesoftware.htmlunit.javascript.host.event.KeyboardEvent;
import lombok.SneakyThrows;
import org.junit.Test;import java.io.FileOutputStream;
import java.io.InputStream;
import java.net.URLDecoder;
import java.util.List;
import java.util.logging.Level;import static java.nio.charset.StandardCharsets.UTF_8;/*** 作用:** @author LinRuChang* @version 1.0* @date 2022/02/08* @since 1.8**/
public class HtmlUnitTest {@Test@SneakyThrowspublic void test13() {WebClient webClient = new WebClient();webClient.setAjaxController(new NicelyResynchronizingAjaxController());webClient.getOptions().setThrowExceptionOnFailingStatusCode(false);webClient.getOptions().setThrowExceptionOnScriptError(false);webClient.getOptions().setCssEnabled(true);webClient.getOptions().setJavaScriptEnabled(true);webClient.getOptions().setActiveXNative(false);HtmlPage page = webClient.getPage("file:///C:/Users/Administrator/Desktop/index5.html");//DomElement downloadBtn = page.getElementById("downloadBtn");DomElement downloadBtn = page.getElementById("downloadBtn2");//触发下载按钮Page clickPage = downloadBtn.click();//下面两句是等价//Page enclosedPage = webClient.getWebWindows().get(webClient.getWebWindows().size() - 1).getEnclosedPage();Page enclosedPage = clickPage.getEnclosingWindow().getEnclosedPage();InputStream contentAsStream = enclosedPage.getWebResponse().getContentAsStream();//获取文件名String responseHeaderValue = enclosedPage.getWebResponse().getResponseHeaderValue(HttpHeader.CONTENT_DISPOSITION);String documentName = responseHeaderValue.split(";")[1].split("=")[1].trim();documentName = URLDecoder.decode(documentName);Console.log("文件下载成功:{}",documentName);//存入数据库IoUtil.copy(contentAsStream, new FileOutputStream("C:\\Users\\Administrator\\Desktop\\图片\\"+ documentName));}}    

在这里插入图片描述

3.5 弹框处理

示例页面

<!DOCTYPE html>
<html lang="en"><head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>HtmlUnit测试</title></head><body><form id="form" onclick="return false;"><div class="container"><input type="hidden" placeholder="Enter Username" name="mark" id="mark" required value="ajax手动提交"><label for="uname"><b>账号</b></label><input type="text" placeholder="Enter Username" name="uname" id="uname" required><label for="psw"><b>密码</b></label><input type="password" placeholder="Enter Password" name="psw" id="psw" required><button id="loginBtn" type="button">登陆</button></div></form><form id="form2" method="post" action="http://127.0.0.1:8080/login"><div class="container"><input type="hidden" placeholder="Enter Username" name="mark" id="mark2" required value="form表单提交"><label for="uname"><b>账号2</b></label><input type="text" placeholder="Enter Username" name="uname" id="uname2" required><label for="psw"><b>密码2</b></label><input type="password" placeholder="Enter Password" name="psw" id="psw2" required><button id="loginBtn2" type="submit">登陆2</button></div></form><a href="http://127.0.0.1:8080/download" id="downloadBtn">下载按钮(当前页面)</a><br/><a href="http://127.0.0.1:8080/download" id="downloadBtn2" target="_blank">下载按钮2(新页面)</a><br/><button id="alertBtn">弹出信息</button><br/><button id="promptBtn">提示框信息</button><br/><button id="confirmBtn">确认框信息</button>		</body><script src="file:///G:/VsCode/开源/jquery-3.5.1/jquery-3.5.1.min.js"></script><script>$(function() {var i = 0;$("#alertBtn").click(function() {alert("点击触发弹框信息: 第" + ++i + "次")})var j = 0;$("#promptBtn").click(function() {prompt("点击触发提示框信息: 第" + ++j + "次", "默认值1111")})var k = 0;$("#confirmBtn").click(function() {confirm("点击触发确认框信息: 第" + ++k + "次")})			//登陆function loginOperation() {$.post("http://127.0.0.1:8080/login", $("#form").serialize(), responseData => {$("body").append(`<h1>${JSON.stringify(responseData)}</h1>`)$("form").hide();}, "json")return false;}$("#loginBtn").click(loginOperation);})</script></html>

在这里插入图片描述

HtmlUnit模拟用户触发弹框

@Test@SneakyThrowspublic void test15() {WebClient webClient = new WebClient();webClient.setAjaxController(new NicelyResynchronizingAjaxController());webClient.getOptions().setThrowExceptionOnFailingStatusCode(false);webClient.getOptions().setThrowExceptionOnScriptError(false);webClient.getOptions().setCssEnabled(true);webClient.getOptions().setJavaScriptEnabled(true);webClient.getOptions().setActiveXNative(false);List<String> alertInfos = new ArrayList<>();webClient.setAlertHandler(new CollectingAlertHandler(alertInfos));//提示框处理final List<String> promptInfos = new ArrayList<>();webClient.setPromptHandler(new PromptHandler() {@Overridepublic String handlePrompt(Page page, String message, String defaultValue) {Console.log("Prompt信息:{}、{}", message,defaultValue);promptInfos.add(message);return StrUtil.blankToDefault(message,defaultValue);}});//确认框消息处理final List<String> confirmInfos = new ArrayList<>();webClient.setConfirmHandler(new ConfirmHandler() {@Overridepublic boolean handleConfirm(Page page, String message) {confirmInfos.add(message);//true确认 false取消弹框return true;}});HtmlPage page = webClient.getPage("file:///C:/Users/Administrator/Desktop/index5.html");DomElement alertBtn = page.getElementById("alertBtn");page = alertBtn.click();DomElement promptBtn = page.getElementById("promptBtn");page = promptBtn.click();page = promptBtn.click();DomElement confirmBtn = page.getElementById("confirmBtn");page = confirmBtn.click();page = confirmBtn.click();page = confirmBtn.click();Console.log("弹框信息:{}", alertInfos);Console.log("提示框信息:{}", promptInfos);Console.log("确认框信息:{}", confirmInfos);}

在这里插入图片描述


http://chatgpt.dhexx.cn/article/EqcJnSpl.shtml

相关文章

【零基础】快速入门爬虫框架HtmlUnit

迅速的HtmlUnit htmlunit是一款开源的web页面分析工具&#xff0c;理论上来说htmlunit应用于网页的自动化测试&#xff0c;但是相对来说更多人使用它来进行小型爬虫的快速开发。使用htmlunit进行爬虫开发不仅是其运行速度快&#xff0c;更重要的是此框架上手更为容易&#xff0…

保研之路——哈深计算机预推免

哈深计算机预推免 个人情况高校复试参与情况哈工深计算机学院直硕&#xff08;7.20&#xff09;结语 嗯&#xff01;抱着不白花这么多路费住宿费的初衷准备写一个保研经验贴&#xff0c;希望学弟学妹少花点钱吧orz 我的战术大概是只要学校给我发了邀请我就去&#xff08;除了时…

哈工大计算机学院统一复试划线,哈工大计算机专业,复试比例101%,擦线党没戏了...

原标题&#xff1a;哈工大计算机专业&#xff0c;复试比例101%&#xff0c;擦线党没戏了 这几天哈工大各院系公布了复试线及复试名单&#xff0c;其中「计算机学院」的复试考生比例居然是101%。 哈工大2020年计算机专业的考研复试线为320分(学术学位)&#xff0c;以及专业学位的…

【2024考研】哈工大计算机考研854会改成408吗?优缺点分析?怎么复习?哈工大卓越工程师学院点击就送吗?

文章目录 1.哈工大计算机考研专业课的发展历史2.哈工大卓越工程师学院点击就送吗&#xff1f;3.哈工大计算机854会改成408吗&#xff1f;4.哈工大计算机854的优缺点分析4.1 优点4.2 缺点 5.哈工大计算机854怎么复习&#xff1f;5.1 计算机系统(CSAPP)复习指导5.2 计算机网络复习…

【考研】哈尔滨工业大学计算机考研854复习资料

哈尔滨工业大学计算机考研854复习资料 0. 考研初试&复试经验贴1. 初试专业课复习资料资源1.1 复习资料下载1.2 复习资料清单 2. 初试专业课复习资料使用指南2.1 CSAPP资料2.2 数据结构资料2.3 计算机网络资料 更新历史&#xff1a; 2022年4月22日完成初稿2022年5月7日加入…

计算机排名哈工大第三,国内计算机高校排名:哈工大稳坐第2,浙江大学第3,西电第8...

QS世界大学计算机H指数(H指数为混合量化指标&#xff0c;可用于评估研究人员的学术产出量和学术产出水平)前50名中&#xff0c;中国有9所(包括香港大学3所)上榜&#xff0c;前100名中有清华大学、哈工大学、浙江大学等14所世界一流大学建设高校&#xff0c;学校有西安电子科技大…

哈工大深圳计算机就业质量报告,多所高校公布毕业生平均年薪,南京大学和哈工大(深圳)数据亮眼...

原标题:多所高校公布毕业生平均年薪,南京大学和哈工大(深圳)数据亮眼 对于高中学子而言,在将来报考大学时,除了根据自己的兴趣爱好之外,还比较关注对应高校的就业率以及就业质量。毕竟将来大学毕业后还是要走向社会就业的。所以就业后的薪资待遇就成了大家乐意关注的一个点…

哈工大2021秋机器学习期末试题

哈工大2021秋机器学习期末试题 刚刚经历了机器学习复习和考试&#xff0c;这过程简直是太折磨了。 这门课的期末考试往年题还是很有参考价值的。所以我在考试的时候抽了点时间把期末题记了一下&#xff0c;希望能对学弟、学妹&#xff08;如果有的话&#xff09;考前复习有所…

哈尔滨工程大学计算机学院保研政策,哈工大保研条件(哈工大2019保研政策)

哈工大保研条件(哈工大2019保研政策) 2020-05-08 10:50:43 共10个回答 去年保研的确实增加了,主要是总校的增加了(40%多),深圳和威海的基本上变化不大,保研率没有超过40%.但是值得特别注意的是,复试中取消了前25%免除笔试的原则.以至于好多总校和威海前25%的同学虽进入复试,却因…

2020哈工大(威海)计算机夏令营面试

2020哈工大威海计算机夏令营面试 6月底收到哈工大(威海)的入营通知&#xff0c;当时我正在参加中南大学的夏令营&#xff0c;因为我校往届也有好多学长学姐保研到哈威&#xff0c;所以入营概率相对较大&#xff0c;也算是我夏令营拿到的为数不多的入营&#xff0c;另外三个分别…

哈工程计算机系保研率,武汉理工VS哈工程,20保研率哈工程高,哪所值得考?学长精准分析...

对于国内的很多工科高校&#xff0c;由于主打的专业都是国民经济不可或缺的专业&#xff0c;但由于近几年实体经济不景气&#xff0c;很多考生都转而报考计算机相关专业、财经类专业&#xff0c;以前很吃香的航空航天类、电气类、材料类专业都不再受热捧&#xff0c;但这类学校…

哈师大计算机学院宿舍,新生攻略|哈师大所有的“秘密”都在这了

原标题:新生攻略|哈师大所有的“秘密”都在这了 你好,我是哈师大17级的新生,我想全面的了解一下咱们学校,应该去哪了解呀? 这你可算是问对人了,听说最近哈尔滨师范大学学生会的官方微信平台出了非常全的新生攻略呢,快关注它们的公众号(hsdxsh)看看吧! 哇!这么棒!我要…

2020哈工程上岸初复试经验

2020哈工程上岸初复试经验 写在前面&#xff1a; 2020年注定是在研究生考试中被记住的一年&#xff0c;这一年考研的同学们都经历了太多的考验&#xff0c;有幸运的&#xff0c;也有不幸的。经过了漫长的等待&#xff0c;终于&#xff0c;拟录取名单下来了&#xff0c;我也很幸…

2019哈工大计算机考研复试,哈工大计算机专业,复试比例101%,擦线党没戏了...

这几天哈工大各院系公布了复试线及复试名单&#xff0c;其中「计算机学院」的复试考生比例居然是101%。 哈工大2020年计算机专业的考研复试线为320分(学术学位)&#xff0c;以及专业学位的电子信息&#xff0c;也是320分&#xff0c;哈工大公布的校线也是这个分数&#xff0c;院…

哈工大计算机报深圳还是本部,哈工大本部和哈工大深圳哪个比较好?

眼下各省市的高考成绩陆续公布&#xff0c;考生和家长们进入了填报志愿的关键时期&#xff0c;这个时候我们会发现一个问题&#xff1a;有些学校会有很多分校或分校区&#xff0c;比如东北大学和东北大学秦皇岛分校、山东大学和山东大学威海校区等&#xff0c;这些校区和分校跟…

哈工程和杭电计算机,哈工程算名校吗?为什么说千万别来哈工程?

选择科目 测一测我能上哪些大学 选择科目 领取你的专属报告 > 选择省份 关闭 请选择科目 确定 v> “哈工程”一般指哈尔滨工程大学&#xff0c;这是一所直属国家工业和信息化部&#xff0c;和教育部、黑龙江省、哈尔滨市共建的全国重点大学。网上有说法是“千万别来哈工程…

RHCE第三次作业

综合练习&#xff1a;请给openlab搭建web网站 ​ 1.基于域名[www.openlab.com](http://www.openlab.com)可以访问网站内容为 welcome to openlab!!! [rootlocalhost ~]# mount /dev/sr0 /mnt #挂载本地光盘 mount: /mnt: /dev/sr0 already mounted on /run/media/zhou2002/RH…

c++的unsigned int和int类型

就如同int a&#xff1b;一样&#xff0c;int 也能被其它的修饰符修饰。除void类型外&#xff0c;基本数据类型之前都可以加各种类型修饰符&#xff0c;类型修饰符有如下四种: 1.signed----有符号&#xff0c;可修饰char、int。Int是默认有符号的。 2.unsigned-----无符号&…

char 和 unsigned char 的区别

一.基本原理 1、char取值范围是 -128~127。 2、我们先来看 signed char的最大值。 最高位是 符号位&#xff0c; 0 代表正数&#xff1b; 1 代表负数。0 1 1 1 1 1 1 1 这个值等于 2^0 2^1 2^2 2^3 2^4 2^5 2^6 127 。 也有一个简便计算方法&#xff1a…

C/C++ unsigned char*类型

C unsigned char &#xff0a;是表示无符号字符指针的意思。 细节如下&#xff1a; char 前面添加unsigned表示是无符号的字符&#xff0c;也就是不可以存储负数&#xff1b; 在数据类型后面加&#xff0a;表示指针的意思&#xff1b; 指针是C和C的一种特色数据类型&#x…