老师我一直没弄明白版本要怎么选择,springboot的版本我要是用最新的了后面用的依赖和springboot版本一致还是说?????
老师 springsession啥时候更新,也没学过,还有springdata
对照了同样问题的同学,依然无法找到原因,麻烦老师看看源代码有什么问题。
jdbcDemo.rar
<!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>Document</title> <style> *{ margin: 0; padding: 0; } .nan{ height: 450px; background-color: palegreen; float: left; padding: 10px; box-sizing: border-box; } .nan>div{ width: 100%; height: 100%; background-color: red; } /* 移动端 */ @media screen and (max-width: 768px) { .nan{ width: 50%; } } /* ipad端 */ @media screen and (min-width: 768px) and (max-width: 992px) { .nan{ width: 33%; } } /* pc端 */ @media screen and (max-width: 992px) { .nan{ width: 25%; } } </style> </head> <body> <div class="box"> <div class="nan"> <div></div> </div> <div class="nan"> <div></div> </div> <div class="nan"> <div></div> </div> <div class="nan"> <div></div> </div> <div class="nan"> <div></div> </div> <div class="nan"> <div></div> </div> <div class="nan"> <div></div> </div> <div class="nan"> <div></div> </div> <div class="nan"> <div></div> </div> <div class="nan"> <div></div> </div> <div class="nan"> <div></div> </div> <div class="nan"> <div></div> </div> <div class="nan"> <div></div> </div> </div> </body> </html>
[object Object][object Object]
老师我这个是怎么回事你,我把他放大就是图1的样子,放小就是图2
在23:08分没有设置开始SLF4J作为日志处理处理,log里面还有显示SLF4J呢?23:分设置的SLF4J作为日志处理的
老师,你好!我想问问在查找偏移量的时候是不是需要对二进制非常熟悉?因为我是零基础的,对于这些二进制和十进制之类的不懂,这个需要怎么学习呢?
from fake_useragent import UserAgent import requests from lxml import etree from time import sleep def get_html(url): ''' :param url: 要爬取的地址 :return: 返回html ''' headers = {"User-Agent": UserAgent().chrome} resp = requests.get(url, headers=headers) if resp.status_code == 200: resp.encoding = 'utf-8' return resp.text else: return None def parse_list(html): ''' :param html: 传递进来一个有电影列表的html :return: 返回一个电影列表的url ''' e = etree.HTML(html) list_url = ['http://maoyan.com{}'.format(url) for url in e.xpath('//div[@class="movie-item film-channel"]/a/@href')] return list_url def pares_index(html): ''' :param html: 传递进来一个有电影信息的html :return: 已经提取好的电影信息 ''' e = etree.HTML(html) name = e.xpath('//h1[@class="name"]/text()') type = e.xpath('//li[@class="ellipsis"]/a[1]/text()') actors = e.xpath('//div[@class="celebrity-group"][2]/ul[@class="celebrity-list clearfix"]/li/div/a/text()') actors = format_data(actors) return {"name": name, "type": type, "actors": actors} def format_data(actors): actor_set = set() for actor in actors: actor_set.add(actor.strip()) return actor_set def main(): num = int(input('请输入要获取多少页:')) for page in range(num): url = 'http://maoyan.com/films?showType=3&offset={}'.format(page*30) list_html = get_html(url) list_url = parse_list(list_html) for url in list_url: info_html = get_html(url) movie = pares_index(info_html) print(movie) if __name__ == '__main__': main()
运行的时候没有反应
老师你好,为什么转数组时传入的数组大小对结果没有影响,我的list有10个数,传入一个长为1的数组,得到的还是一个长为10的数组
List<Integer> list = new ArrayList<>(); for (int i = 1; i <= 10; i++) { list.add(i*2); } Integer[] numArr = list.toArray(new Integer[1]); System.out.println(numArr.length); // 结果为10 System.out.println(Arrays.toString(numArr)); // 结果为2,4,……,20共10个数
java.sql.SQLException: The server time zone value '�й���ʱ��' is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the 'serverTimezone' configuration property) to use a more specifc time zone value if you want to utilize time zone support. at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:129) at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97) at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:89) at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:63) at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:73) at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:76) at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:836) at com.mysql.cj.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:456) at com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:246) at com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:197) at org.mybatis.generator.internal.db.ConnectionFactory.getConnection(ConnectionFactory.java:68) at org.mybatis.generator.config.Context.getConnection(Context.java:526) at org.mybatis.generator.config.Context.introspectTables(Context.java:436) at org.mybatis.generator.api.MyBatisGenerator.generate(MyBatisGenerator.java:222) at org.mybatis.generator.api.MyBatisGenerator.generate(MyBatisGenerator.java:133) at GeneratorSqlmap.generator(GeneratorSqlmap.java:27) at GeneratorSqlmap.main(GeneratorSqlmap.java:33) Caused by: com.mysql.cj.exceptions.InvalidConnectionAttributeException: The server time zone value '�й���ʱ��' is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the 'serverTimezone' configuration property) to use a more specifc time zone value if you want to utilize time zone support. at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:423) at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:61) at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:85) at com.mysql.cj.util.TimeUtil.getCanonicalTimezone(TimeUtil.java:132) at com.mysql.cj.protocol.a.NativeProtocol.configureTimezone(NativeProtocol.java:2120) at com.mysql.cj.protocol.a.NativeProtocol.initServerSession(NativeProtocol.java:2143) at com.mysql.cj.jdbc.ConnectionImpl.initializePropsFromServer(ConnectionImpl.java:1310) at com.mysql.cj.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:967) at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:826) ... 10 more
我运行的时候就这个样子了,我的数据库是8的,jar包也换了。
老师 视频中提到w3school网页中的框架 不是用iframe写的 我想问下 还有哪种框架 现在用的主流框架是什么
emp1 = new Employee(ID:1001, name:"高小一", job:"程序员", baseSalary:20000, salary2:0, hiredate:"9 月 1 日", address:"北京");
new 什么意思,怎么用
<!--提交按钮--> <input type="submit" value="提交" /><br /> <!--清除按钮 清空我们写的内容--> <input type="reset" value="清除"/> <!--普通的按钮--> <input type="button" value="提交" />
老师对于这个按钮 视频中展示的网易注册按钮背景颜色是红色 这个是怎么写的 bgcolor吗 但是这个会出现错误
<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title>伟大</title> <!--优化搜索引擎--> <meta name="author" content="王伟"/> <meta name="description" content="不知道" /> <meta name="keywords" content="东风"/> <!--自动刷新网页--> <meta http-equiv="refresh" content="2,http://www.bjsxt.com"/> <!-- 禁止网页缓存 --> <meta http-equiv="expires" content="0"/> </head> <body> hellow world </body> </html>
老师这个禁止网页缓存和自动刷新网页怎么感觉有点矛盾啊?他的缓存不是更新的意思吗?那为什么还可以跳转网页啊?
老师,我在使用多线程爬取文件的时候,会出现文件写入不全,然后我在写入文件的的时候加入锁,但是发现还写入不全,您帮我看一下!
from threading import Thread,Lock import requests from lxml import etree from fake_useragent import UserAgent from queue import Queue class Spider(Thread): def __init__(self,url_queue,lock): Thread.__init__(self) self.url_queue = url_queue self.lock = lock def run(self): while not self.url_queue.empty(): url = self.url_queue.get() print(url) headers = {'User-Agent':UserAgent().chrome} resp = requests.get(url,headers=headers) e = etree.HTML(resp.text) contents = [div.xpath('string(.)').strip() for div in e.xpath('//div[@class="content"]')] #加入锁 self.lock.acquire() with open('qiushi.text', 'a', encoding='utf-8')as f: for content in contents: f.write(content+'\n') self.lock.release() if __name__ == '__main__': base_url = 'https://www.qiushibaike.com/text/page/{}/' lock = Lock() url_queue = Queue() for num in range(1,14): url_queue.put(base_url.format(num)) for i in range(6): spider = Spider(url_queue,lock) spider.start()
hello world可以原样输出,我是王禹硕就不能原样输出
非常抱歉给您带来不好的体验!为了更深入的了解您的学习情况以及遇到的问题,您可以直接拨打投诉热线:
我们将在第一时间处理好您的问题!
关于
课程分类
百战程序员微信公众号
百战程序员微信小程序
©2014-2025百战汇智(北京)科技有限公司 All Rights Reserved 北京亦庄经济开发区科创十四街 赛蒂国际工业园网站维护:百战汇智(北京)科技有限公司 京公网安备 11011402011233号 京ICP备18060230号-3 营业执照 经营许可证:京B2-20212637