某高校英语测试题

正则写的比较粗劣,不过爬取目的实现了,这个版本是爬取本地的jsp文件。然后输出到控制台,并没有输出到文件 

package main

import (
	"fmt"
	"os"
	"regexp"
	"strconv"
)

func main() {

    var unit string='1'
	for i := 0; i <= 49; i++ {

		file, err := os.Open("./English/B3U"+unit+"/detail(" + strconv.Itoa(i) + ").jsp")
		if err != nil {
			fmt.Println("file open err")
		}

		b := make([]byte, 1024*10)
		_, err1 := file.Read(b)

		if err1 != nil {
			fmt.Println("file read err")
		}

		//fmt.Println(string(b[:n]))

		prob := regexp.MustCompile(`<input type='hidden' name='\d+_content' id='\d+_content' value='(.*)<iframe`)
		if prob == nil {
			fmt.Println("regexp.MustCompile err0 ")
			return
		}
		pr := prob.FindAll(b, -1)

		answ := regexp.MustCompile(`checked></th>
        <td><label>
        \s(.*)
        </label>`) //(.*)
		if answ == nil {
			fmt.Println("regexp.MustCompile err1 ")
			return
		}

		an := answ.FindAll(b, -1)

		//fmt.Println("===", len(pr))
		for _, data := range pr {
			fmt.Println(string(data[58 : len(data)-9])) //64 58
		}
		//fmt.Println("===", len(an))
		for _, data := range an {
			fmt.Println(string(data[35 : len(data)-9])) //40  35
		}

	}
}

简单替换了一下,结果内容如下

B3U1

1. She was able to _________her own suffering and help others.
      B. transcend
       
2. The private school&amp;#39;s director ______ Mr. williams as his official representative at the conference.
      C. nominated
       
3.Unfortunately, not every magazine is produced and edited __________ of excellence.
      D. in the pursuit of
       
4. He spent 16 years with one company and ______ a top  management position.
      A.worked his way into
       
5. My dictionaries ___________great helpers in my study.
      C.act as
       
6.I am sorry to tell you that you ______his attempt to get the position.
      B.fail in
       
7. The Qin _______ six rival states and emerged as the only power posed to unify China.
      A.triumphed over
       
8.I would like to _____ your for the support you give with your excellent article to rural artist.
      D. commend
       
9. You have to be really ______about who you are and what you are trying to achieve.
      C. clear-cut
       
10. Those who _________ one pare of the plan are almost certain to deviate from the whole in the end.
      D. deviate from
       
11. Better options may come along later, and taking the first option will ______them _______being free for the later and better ones.
      A.preclude&#8230;from
       
12. Don&amp;#39;t _______too soon, you may got successful.
      B. wirite off
       
13. Driving is a serious______and all drivers must remain alert and awake.
      A. endeavor
       
14. The president swore to ______ the constitution.
      D. uphold
       
15. He is as____as a bee.
      C. deligent
       
16. Smokingis a known _______to sleep.
      D. handicap
       
17.Often some physical or mental______prevents a child from learning.
      D. handicap
       
18. This ____has never been approached by any player in baseball history.
      C. feat
       
19. He felt so tired after the long journey that he ignored  his job and began to _______when he was at work.
      A. slack off
       
20. The local authority is ______ on the job of keeping the streets clean.
      B. falling down
       
21. Only a few people nowadays are able to _____ friends into adulthood.
      C. maintain
       
22. The story caters to everyone&amp;#39;s______yearning for success
      A. inward
       
23. He worked ______and spent long hours in the laboratory.
      C. deligently
       
24.The old universities of Oxford and Cambridge still have a lot of _____.
      D. prestige
       
25. He was hospitalized last week, the next day after he was___to the finance ministry.
      B. appointed to
       
26. His young instructor failed to turn up at the ______time.
      D. appointed
       
27. We will have to _____ all our energies on the development of our communities.
      B. knelt
       
28. Officials say they received a bomb_____ at about 9:30 a.m.
      C. threat
       
29. When she heard about her husband&amp;#39;s ______experience, she could hardly choke back her tears.
      A. tragic
       
30. She felt it was her ____duty to give the police the names of the destroyers.
      C. civic
       
31. Personal history, educational opportunity, individual dilemmas---- none of these can _____ a strong spirit committed to success.
      C. inhibit
       
32. Take the example of two of the most ______scientists of our age, Albert Einstein and Thomas Edison.
      A. scholarly
       
33. They both were called&amp;quot; slow to learn&amp;quot; and ______ as idiots by their teachers.
      B.written off
       
34. Roadways, bridges, overpasses, and interchanges could run through or _______urban areas.
      A. bypass
       
35. In the end, both Einstein and Edison overcame their childhood ______ and went on to achieve magnificent discoveries.
      D.persecution
       
36. Consider also the heroic example of Abraham Lincoln, who faced substantial hardships, failures and repeated ______in his lifetime
      C. misfortunes
       
37. The volunteers&amp;#39; ______ and support have been invaluable for the Art Association&amp;#39;s funds.
      A. dedication
       
38. Although they were poor,disabled or ill, they faced life with ________and vigor.
      D. optimisim
       
39 . The promise of bonuses or gifts can ______workers to higher achievement.
      A. spur
       
40. His strong will was the _____ that pushed him forward .
      B. spur
       
41. The Chinese people have a glorious _____tradition, and they are great peace-loving people.
      B.patriotic
       
42. The new computerized system removed 700 people____their jobs
      A. from
       
43. He eventrally had a ______army career whereby he was later elected prime minister.
      D. premier
       
44. In the late 1950s, the slaughter of dolphins began on an ______scale.
      B. unprecedented
       
45. The lecture which lasted about three hours was so _______that the audience couldn&amp;#39;t help yawning.
      C. tedious
       
46. The group of technicians are engaged in a study which ______all aspects of urban planning.
      D. embraces
       
47. She keeps a supply of candles in the house in case of power____.
      Afailure
       
48. At yesterday&amp;#39;s party, Elizabeth&amp;#39;s boy friend amused us by ____ Charlie Chaplin.
      C.imitaing
       
49. Please _______dictionaries when you are not sure of words
      D.consult
       
50. There is a ____ of impatience in the tone of his voice.
      A. hint




B3U2
I can we
  • 8
    点赞
  • 15
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值