正則寫的比較粗劣,不過爬取目的實現了,這個版本是爬取本地的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&#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…from
12. Don&#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&#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&#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&quot; slow to learn&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&#39; ______ and support have been invaluable for the Art Association&#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&#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&#39;s party, Elizabeth&#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 wear my watch when I swim because it is _________.
water-proof
The bar has become _________as a meeting place for drug dealers.
notorious
He had hurt his foot and had to&#160;________&#160;along.
hop
Her grandfather is very old and ________, and he only gets around in a wheel chair.
feeble
As the tide ________, we were able to look for shells.
receded
Her life was a series of ups and downs, which was both comic and&#160;________.
pathetic
Flooding is a major ________, which tends to cause a heavy loss of life.
catastrophe
My car broke down but luckily someone gave me a ________.
tow
If you want to know how much this old painting is worth, have it &#160;________ by an art dealer.
appraised
You need to see a doctor at the first sign of&#160;________ of the flue.
symptoms
I wouldn&#8217;t ________ her if I were you-she is smarter than you think.
underestimate
As a result of his injuries, he has become partially ________ on his left side.
  paralyzed
During the war, the city was ________ by bombs.
battered
His additional explanation simply promoted confusion rather than________.
clarity
A large of number of people ________from hunger and thirst.
perished
During the match, the boxers were _______each other.
pounding
The idea is interesting but not _______, I am afraid.
practicable
We must help these children; they are on the _______of starvation.
brink
In between appearances on TV and radio broadcasts, Mr. Fletcher holds an_______ news conference.
impromptu
We drove up a hillside and finally stopped on a high&#160;______.
ridge
She made a sudden&#160;______and began walking the opposite direction.
whirl
John is an&#160;&#160;______boy. He is good at running.
athletic
She assumed an air of confidence in spite of her&#160;______.
dismay
I need experience to get a job but without a job I can&#39;t get experience it&#39;s a&#160;______circle.
vicious
He will&#160;_____&#160;you through the forest.
escort
He watched the airplane&#160;_____&#160;higher and higher.
ascend
He did not greet his children with the usual_____&#160;and kiss.
hug
The argument between the two boys became so fierce that Dad had to&#160;_____&#160;.
intervene
In most cases his family could gain some financial&#160;_____&#160;.
assistance
He has learnt to deal properly with all kinds of&#160;_____&#160;situations.
complicated
The noise made by the children outside&#160;_____me from my reading.
distracted
He changed his name in order to avoid confusion with the_____&#160;criminal.
notorious
The pictures in this book&#160;_____&#160;when the pages are opened, to amuse children.
pop up
I&#160;_____&#160;&#160;it an honor to accept your invitation.
  deem
Do not_____&#160;&#160;your ability; everyone has unlimited potential.
underestimate
Don&#39; t play by the river in case you fall in and_____&#160;.
drown
I could not&#160;_____&#160;him no matter how hard I tried.
convince
He learned to his&#160;_____&#160;that he had lost his job.
dismay
They preferred death to surrender in their&#160;_____&#160;against the enemy.
struggle
He smiled, but there was some other emotion just below the&#160;&#160;_____.
surface
Your enemies will&#160;&#160;&#160;_____&#160;everything you say.
  twist
The meat had disappeared from the kitchen and the cat&#39;s&#160;&#160;_____&#160;prints on the table told their own tale.
paw
Let&#39;s&#160;&#160;_____&#160;&#160;the heavy box out of the cupboard.
drag
He was&#160;&#160;&#160;_____&#160;for work to provide for a large family.
desperate
His plan seemed to be too difficult, but before long it proved to be&#160;&#160;&#160;_____.
practicable
There were shouts of&#160;_____&#160;when our football team won the cup.
triumph
We were on the_____&#160;of disaster when the rescue team arrived.
brink
She was not beautiful; she did not&#160;_____her mother.
resemble
An employer should be able to _____the ability and character of his workers.
appraise
After some hesitation we decided to&#160;&#160;_____&#160;the mountain.
ascend
B3U3
1. This school has made many contributions to management.
B. noteworthy
2.Recent research in the clinical has benefited from the incorporation of multiple methods of measurement.
A. domain
3. A UN agency spokesman says as many as 100,000 people have already fled the country, and more are likely to follow.
B. refugee
4. The etched metal-film grids are very and easy to distort, wrinkle or tear.
D. fragile
5. by an unexplained illness, he missed school for the next two weeks.
A. Afflicted
6. It is difficult to feelings in words.
C. portray
7. The arms trade should be subject to controls.
D. rigorous
8.The manager people as often as he can. It takes no time at all, but it makes a big difference.
A. compliments
9. The hospital knew they couldn&#39;t charge the patients any money, but for reasons they provided their services.
B. humanitarian
10. Her parents&#39; had a profound effect on her life.
C. divorce
11. She held her tongue, realizing that anger could only ( )their relationship.
D.jeopardize
12.We politely the invitation.
A. turned down
13. She was not only a successful doctor but also a fine mother and a daughter-in-law.
C. conscientious
14. I have seen how she gathers courage to embark ( )a long journey all by herself.
B. on
15.The vanguard(�ȷ�) role of the Communists is of vital importance.
A. exemplary
16. and economic recession accelerated the pace of decline of this region.
B. Drought
17.To Tom&#39;s surprise, he was the only of his uncle&#39;s will.
D. beneficiary
18. You even want to us of the freedom of our hearts.
C. deprive
19.Our happiness or depends on our dispositions(����), and not on our circumstances.
A. misery
20.Let&#39; s share our troubles as well as in our joys.
D. in
21. It was said that Portman studied dance to better her character.
B. portray
22. Good pparents lead example rather than only tell their children what to do.
C. by
23.Mary had proven to be an educator to her students and a trusted and cherished friend to her colleagues.
D. exemplary
24.He presented his credentials to the President in his character as .
A. ambassador
25.They called on their members to demonstrate against the of the police.
D.brutality
file read err
27.A teenage boy called 911, claiming to be held ��&#12288;&#12288;�� in a house.
A. captive
28. A deer suddenly out into the street from inside the forest.
C. darted
29. The cold wind made the boy inside his coat.
A. huddle
30. The odor of smoke couldn&#39;t hide the smell of the dirty room.
B.foul
31.The president is said to receive an letter yesterday.
D.anonymous
32.The summer day by the lake in the countryside was ( )and beautiful.
B. serene
33.His young wife greeted me at the door and invited me to have a seat.
C. gracious
34.The grades that students receive how well they did in their studies.
D. signify
35.His legend lived and was made into a popular film in 1973.
A. on
36.I don&#39;t want to turn a friend who asks for help.
B. down
37.People always the memory of the national hero.
D. cherish
38.I pray you let me not deprive you your servant.
A. of
39.Famine and war still mankind.
B. afflict
40.We received an letter.
C. anonymous
41.The ruler&#39;s forced unarmed citizens to defend themselves.
A. brutality
42.Most of the Asians live rice.
D.on
43.The cat came inside from the rain and behind the heater to warm up again.
B. huddled
44.To get a doctoral degree, you are required to have ( ) training in research and specialized knowledge in your subject areas.
A. rigorous
45.The young couple will for Dalian next week.
C. embark
46.The cow is a animal in Hindu culture.
D. sacred
47.The Chinese Red Cross has sent five planeloads of relief supplies to the area that was by the earthquake.
B. stricken
48.The doctor works in the of public health.
A.domain
49.He was taken at this battle.
D. captive
50.He made a study of the plants in the area.
C. rigorous
B3U4
1. The old man was _________with pain.
B. groaning
2. Do you want to ______your friend who is broken-hearted?
C. console
3.I am sorry your life is so __________; I only wish I could help in some way.
D. burdensome
4. We tried to offer her ______ , but she kept crying anyway.
A. consolation
5. We duly became _________ and flew back to the base with no further trouble.
C. airborne
6. The part of the country is covered with _________ forests.
B. dense
7. People _________ around the bus stop.
A. clustered
8. Beach volleyball was introduced to the Olympic Games, which helped _________ the sport.
C. globalize
9. The visit marks the 10th _________ of diplomatic relations between the two countries.
D. anniversary
10. The pillar that supports the house looked _________ shaky and dangerous.
B. decidedly
11. In the face of the economic crisis, we should take up _________ responsibility.
D. corporate
12. In many countries, _________ education has been adopted in order to elevate the average level of education.
A. compulsory
13. Their salary increase will be _________ by rising prices.
C. offset
14. The company is the world&#39;s largest destroyer of _________ forests.
B. tropical
15. By reading the advertisement, you may find something you want _________.
A. on sale
16.The civil _________ minister ordered all the planes to be grounded.
C. aviation
17. This animal is to be found only in the southern _________.
A. hemisphere
18. It is an _________ that the more technology we get, the less time we have to relax.
B. irony
19. He&#39;s so _________ that nobody can prevent him from doing things once he has made up his mind.
D. stubborn
20. The young surgeon _________ the difficult kidney transplant operation.
A. contemplated
21.The smell of fish and eggs _________ the street as families prepare for dinner.
C. saturates
22. He _______ his watch ______ Tom&#39;s basketball.
D. traded...for
23. The overuse of _________ natural resources will undoubtedly result in ultimate shortages.
A. finite
24. When reading a poem, you must understand it far beyond its _________sense.
C. literal
.As children grow older, their _________ processes become sharper.
B. cognitive
. He was _________ for 10 years, but he still held on to his belief.
D. imprisoned
. The teacher delivered a speech that contained praise _________ blame.
A. mingled with
. It was hard to return to _________ matters after such excitement.
B. mundane
. The city has many restaurants with _________ foods.
D. exotic
.The general&#39;s supporters _________ him with an almost godlike status.
C. endow
31.I don&#39;t like to visit the doctor just for something_________.
A. trivial
32.I&#39;m sure they will ________ any comments and suggestions from everyone.
D. be open to
33. The author&#39;s style suggests a certain _________ in his moral view.
B. ambiguity
34. It is a mile around the _________ of the playground.
C. circumference
35. It was fashionable for men to wear their hair long, but wearing short hair has been enjoying something of a _________ recently.
A. renaissance
36. Every _________ of college life is fascinating.
D. facet
37. Are we so _________ that we cannot learn from others?
B. insular
38. Living in a big city has advantages, but it also has _________.
C. drawbacks
39. The airlines have come up with a new solution to the problem of _________.
A. jet lag
40. _________, people are not happy because they are too easily affected by the outside world.
B. more often than not
41.It was the _________ of the country&#39;s policy to revive national economy.
D. cornerstone
42. The_________ of the island is 20 degrees south.
C. latitude
43.The_________ of New York is 74 degrees west of Greenwich.
A. longitude
44. We have to face the challenges of the new _________ economy.
B. globalized
45. She sat down beside me and _________ abour her working day.
D. groaned
46. The _________ of the injured man came from next door.
C. groans
47. The ship was barely visible through the _________ fog.
A. dense
48.It has been found that there are two specific regions in the left _________ whhich are usually used for language.
B. hemisphere
49. I love Zhu Ziqing&#39;s_________, and I think it&#39;s the best in the language.
C. prose
50. She wrote more than 30 novels and collections of ________.
D. verse
B3U5
1. The examination supervisor warned students not to _______ themselves by cheating on the exam.
A. degrade
2. An unbalanced diet has an _______ effect upon health.
D. adverse
3. If you don&#39;t _______ to the traffic laws, you might get hurt.
D. conform
4. A spokesman for the finance department said costs generally rise when_______ increases.
C. revenue
5. She sacrificed her pleasure and _______ to look after the old man.
B. pastime
6. Charities rely on _______ donations.
A. voluntary
7. A will allows people to _______ someone as receiver of their property when they die.
B. designate
8. His suggestion and our plan just _______.
C. coincide
9. Try to _______ your knowledge of history with your knowledge of geography.
C. correlate
10. Employee qualities such as being cooperative and industrious are often _______ by managers.
A. esteemed
11. Most children are _______ to junk food.
D. prone
12. She vowed to herself that she would _______ her life to scientific studies.
B. dedicate
13. Be careful about the _______ of detail in your descriptions.
A. precision
14. All classroom practice will be geared to encouraging and _______ not only students&#39; learning habits but also students&#39; creativity.
C. fostering
15. The new and growing international market could provide a strong _______ to all countries.
A. incentive
16. My father gained a bare _______ of family by his own hands.
C. livelihood
17. The amount of money one makes is not the only _______ of one&#39;s success.
B. gauge
18. He was a short, thick-set man, with coarse, _______ features.
D. commonplace
19. The core of company _______ is the upgrade of technology and products.
A. innovation
20. Today,all of us live in an increasingly _______ world.
A. automated
21. She asked him a few things about his _______ exam, and he told her his plans in detail.
D. upcoming
22. It requires great pains to spell out this _______ manuscript.
D. medieval
23. They agreed to maintain production and _______ from severe wage reductions.
B. refrain
24. It&#39;s video games, which for certain kids can be as powerfully _______ as heroin, some doctors contend.
C. addictive
25. The first newspapers were simply devices for organizing _______, and that, to a greater or less extent, they have remained.
B. gossip
26. How is she paying for her _______ holiday with her modest income?
A. extravagant
27. The newly released variant of the existing cancer drug, scientists have found, is directly _______ to nerve cells.
A. toxic
28. The center provides an _______ of services including surgery, rehabilitation and pain management.
C. array
29. I think the present armed clash on the border was a _______ to make their people forget the internal difficult economic situation
C. diversion
We insist on requesting challenging activities even in our _______, because without challenges, there can be no game.
B. diversions
. The international community is also offering assistance, including the United States, France and China, _______.
D. to name only a few
. The best cure for unhappiness is to _______ yourself into your work
D. hurl
. The government has made it a rule to fill the ranks by a draft, because the volunteers for military service never _______.&quot;
A. suffice
. Which is the most _______ description depends on the point or purpose of asking the question .
B. apt
35. _______ policies play an important role in attracting foreign investment and developing a strong economy.
C. Monetary
36. You should hold the book at a proper distance from you eyes; _______ reading distance is between 15 to 22 inches from your eyes.
C. optimum
37. The conference hall is provided with facilities for _______ interpretation in five languages.
D. simultaneous
38. Their firm is too small to _______ with large multinational corporations.
A. contend
39. On New Year&#39;s Eve, we _______ the time until midnight.
C. count down
40. As the selling season is _______, lots of fresh orders will pour in.
D. at hand
41. Economists fear that any conflict between the two countries could have _______ effects on global financial markets.
A. adverse
42. The city has a few modern buildings in the central area which do not _______ with the style of the city&#39;s overall character.
C. conform
43. John said he&#39;d vote for the candidate even if his beliefs were the _______ opposite of his own.
B. polar
44. The melting of the _______ icecaps and the rise in the sea level are only the most commonly cited effects of climate change.
C. polar
45. To relieve the stress caused by her job, she turned to painting, a _______ she had loved since childhood.
A. pastime
46. Indeed, the State&#39;s interests may not _______ with those of the individual.
D. coincide
47. Every decision is made of a person&#39;s free will, and is _______, unless it is effected by compulsion.
A. voluntary
48. Rising temperatures and the associated earlier spring snowmelt _______ with increasing amounts and size of wildfires in the western United States.
B. correlate
49. He is held in high _______ by colleagues in the construction industry.
C. esteem
50. The new president said she would ______ herself to protecting the rights of children, the old and the homeless.
D. dedicate
B3U6
1. One of the things constantly on my mind is how we can have a larger impact from a research ______.
B. standpoint
2. During this phase, stars______ that heat, shining brightly like our sun, mostly at optical wavelengths.
C. radiate
Could you ______being human without using objects to negotiate the world?
A. conceive of
He said he would ______officials to testify in parliament.
A. summon
Just ______and watch your head, there&#39;s rock throwers on the left.
D. stay down
It took three years to ______the courage to step outside my comfort zone.
C. summon
The two boys______ at one another, and fought over who would get to ride the bicycle first in the street.
A. tugged
He hurried across the stream and reached a______ .
B. meadow
I suppose every filmmaker has the______ , even pathetic dream that his film could be the one that finally stops a war.
D. naive
If the bus was trapped in that mess, there was virtually no way to______ those four kids.
C. evacuate
At the High Court in Dundee, a jury took two hours to______ him of murder.
A. convict
Even a living room sofa can provide comfort and closeness for a couple or family as they ______ to eat popcorn and watch a movie.
A. huddle together
To portray him out of context could make him appear ______and unworldly.
A. naive
Gaps in health outcomes have multiple causes, but poverty is the most ______factor.
C. pervasive
We assume that we must &#8220;overcome&#8221; fear to ______a pool, or develop confidence so we can make a public presentation.
B. dive into
If there are no problems at the point of entry, the officer will authorize you to enter Canada as a permanent ______.
B. resident
Some people will do anything to ______bad policy and save the planet.
B. overturn
Maybe because there are so few Icelanders in the world, we know ______about them.
D. next to nothing
Don`t complain any longer. You should be more ______of all that you possess at the moment.
D. jealous
The 21st century will ______ many of our basic assumptions about economic life.
D. overturn
We ______the feelings and thoughts that we hold inside, whether we speak them or not.
C. radiate
But we are all ______of one another, which is another way of belittling the King.
D. jealous
He warns that several additional towns might be asked to______ in the future.
D. evacuate
The securities laws are so wonderfully fluid that a jury can be found to______ anybody on Wall Street of anything.
D. convict
Mary`s cell phone reception was so weak that even if she ______the receiver ______her ear, she still couldn`t hear what Tom was saying.
A. pressed…to
You also have a tendency to ______ and to bear grudges.
A. brood
The animal trainer was seriously hurt when one of the lions ______his back.
A. clawed
If for any reason you cannot avoid drinking alcohol, drink water soon after or ______your alcoholic drink with ice or water.
A. dilute
Whom do I try to______ in my arms�� Dreams can never be made captive.
B. clasp
There is so much conflicting advice about diet and ______.
B. nutrition
______ figures in Wednesday&#39;s quake were too preliminary to draw any conclusions about the ratio of student deaths.
C. Casualty
These lobsters were so big that just the meat in their ______was enough to make a meal.
D. claws
Whether you______pain on another human or to an animal, the great accountability is the same.
B. inflict
All kinds of people, languages and dialects______ the city.
A. permeate
They collect and sell ______ metal to cover their rent and care for three grandchildren.
A. scrap
There he is dimly recognized as a former ______ by Javert (Russell Crowe), the local police inspector.
A. convict
It doesn`t bother me that I ______whenver I am embarrassd because many people do so.
D. flush
In addition to tougher gun laws, an even more enlightened approach is to tax______ .
D. ammunition
One firefighter died and several others were injured in the______ .
C. blaze
It is unimaginable that in just seconds, pupils and teachers were killed &#8212; it is an ______crime
A. appalling
Until last year, the area was still classified by city authorities as an illegal ______.
B. slum
When ______fruits ripen, they change their colours or scent which appeal to humans, to &#8216;invite&#8217; us to take them.
C. edible
He received a national news Emmy Award for his ______of the 1988 Sudan famine.
B. coverage
Their attitudes______ the media and other influential institutions.
C. permeate
So I started on the outside, to the back, hoping to avoid the ______ of swimmers at the start.
B. tangle
But officials insist the move does not mark the start of a campaign to ______simplified characters.
D. scrap
The sun strikes their windows and makes them ______as if the whole building were on fire.
A. blaze
This will limit the number of ______ dogs in the area.
D. stray
It&#39;s also important to note that the Turkish man who was arrested, was a ______here.
C. resident
In the story, the girl ______from the road and got eaten by the big wolf.
A. strayed