Code Monkey home page Code Monkey logo

assignment1's Introduction

Assignment1

每个人都有自己的教务账号,现在请你用类似于课上讲解的爬虫方法将你自己在教务网站上的成绩表格以HTML代码的形式爬取下来,并写入到一个.html文档中,HTTP请求所要用到的辅助包HttpRequest已经上传至Assignment 1的repository下。该包的使用说明见:https://github.com/kevinsawicki/http-request 最后HTML结果显示应如下图所示(每个人对应自己的成绩单,故每人的结果应该均不相同): screenshot #####要求:

  1. 独立完成,严禁抄袭,一旦被查重系统MOSS判定为抄袭并无法做出合理解释者,第一次予以警告并记此次作业0分。若再被发现,直接挂科。
  2. 最终请将你所写的Java代码以及爬取结果一同打包至.zip压缩包中,命名格式:学号-姓名-Assignment1。
  3. 所有作业请提交到Github上Assignment1 repository下的submit-homework文件夹下,所有提交至其他地方的作业视作无效。
  4. Deadline:10月1日 0:00

#####常见疑难杂症:

  1. 眼瞎,各种url写错,正确形式如下:
    String url = "http://210.42.121.241/servlet/GenImg";
  2. 看不到输出,不知道运行成功没有?
    if(response.ok()){  
    	response.receive(new File(fName));  
    	System.out.println("ok");//这里加上输出信息  
    }
    
  3. eclipse里面看不到下载的图片啊,怎么办?
    1. 去项目文件夹下看
    2. 刷新下左边的project就会出来
    3. 建议加个img文件夹存储,记得刷新查看,eclipse缓存很严重:
    String fName = "img/test"+Integer.toString(counter)+".png";  
  4. 怎么模拟登录啊,有验证码呢?
    • 明显没去好好听课嘛,王爷的课怎么能不好好听呢; 荧神你真是够了(╯‵□′)╯︵┻━┻
    • 提示:通过cookie实现模拟登录,不给代码了,这个告诉大家了就等于我们帮你做作业了。大家自己去HttpRequest翻文档吧。
    • cookie如何查看就不用我再讲了吧,不会的拖出去打一顿,另外再说明一下,chrome、firefox、IE都是可以F12打开调试窗口查看network的,但是建议用chrome,至于360、猎豹、百度什么的拖出去打死好了
  5. 关于教务部网站崩了的若干问题处理
    • 可以去爬其他网站,不用在教务部网站这棵树上吊死,比如去祸害什么csdn、优酷、爱奇艺什么的
    • 别去爬一样的网站首页,去爬一些标识性比较强的页面,这样不容易让我们认为你是copy的
  6. url编码问题:
    url里面如果有中文字符和空格符,请不要直接使用,这需要服务器支持才行,所以请把此类url输入到浏览器中,再复制回来,可以就得到encode的url了,详情你们可以百度URL编码
  7. 之后你们有问题可以写在readme文件里面通过作业提交!

assignment1's People

Contributors

oliverxyy avatar snowyenjoy avatar bazhijing avatar eosw avatar smoumas avatar yuan233 avatar channel960608 avatar czhsmybzd avatar zhihengli-ur avatar inksmallfrog avatar unique0lai avatar tt593526541 avatar liuguang797 avatar zyc1 avatar vintony avatar silvercrux avatar echomini avatar 2014302580382-pengxixi avatar 2014302580267 avatar fatcat-tt avatar nymar123 avatar britaryzhou avatar miao3723 avatar lxsyz avatar loveeason avatar ljbht avatar lijiayingeliza avatar justicevita avatar heqi0313 avatar heniyilian avatar

Watchers

James Cloos avatar Liu Liwei avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.