复制特定的传出链接

时间:2009-03-06 23:22:58

标签: hyperlink

网站上有46个链接:http://www.math.hmc.edu/~ajb/PCMI/problem_solve.html。我想要从第7个链接到第33个链接的链接。我需要将它们分成一个文件。 我可以复制外发链接吗?

2 个答案:

答案 0 :(得分:1)

的Grep来源
<a href 

然后将结果导入vim并使用以下命令

%s/.*<a href="\(.*\)">.*/\1/g

pcmi08_b.pdf
pcmi07_b.pdf
pcmi06_b.pdf
pcmi05_a.pdf
pcmi05_b.pdf
pcmi04_b.pdf
pcmi03_b.pdf
http://www.math.hmc.edu/putnam/
pcmi_classic.pdf
pcmi_classic.tex
http://www.math.hmc.edu/putnam/seminar.shtml
pcmi_tng.tex
pss_solution.pdf
pss_solution.tex
http://www.maa.org/mathhorizons/
http://www.maa.org/pubs/mathmag.html
http://www.maa.org/pubs/cmj.html
http://www.maa.org/pubs/monthly.html
http://www.math.hmc.edu/funfacts/
http://mathforum.org/students/
http://mathworld.wolfram.com
http://www.cecm.sfu.ca/projects/ISC/
http://www.research.att.com/%7Enjas/sequences/index.html
http://ams.rice.edu/mathscinet/
http://mathforum.org/wagon/
http://math.scu.edu/putnam/index.html
http://www.unl.edu/amc/a-activities/a7-problems/putnam/
http://www.unl.edu/amc/a-activities/a7-problems/problemarchive.html
http://www.amazon.com/exec/obidos/ASIN/0387982191/ref=pd_sxp_elt_l1/t/002-7200940-4079202
http://www.amazon.com/exec/obidos/tg/detail/-/038790803X/ref=pd_sim_books_1/t/002-7200940-4079202?v=glance&amp;s=books
http://www.amazon.com/exec/obidos/tg/detail/-/0471135712/ref=pd_sim_books_2/t/002-7200940-4079202?v=glance&amp;s=books
http://www.amazon.com/exec/obidos/tg/detail/-/0817641556/ref=pd_bxgy_text_1/t/002-7200940-4079202?v=glance&amp;s=books&amp;st=*
http://www.amazon.com/exec/obidos/ASIN/0387947434/ref=pd_pym_rvi_1/t/002-7200940-4079202
http://www.amazon.com/exec/obidos/ASIN/0883855194/ref=pd_sxp_elt_l1/t/002-7200940-4079202
http://www.amazon.com/exec/obidos/tg/detail/-/0883853256/qid=1057672535/sr=8-1/ref=sr_8_1/t/002-7200940-4079202?v=glance&amp;s=books&amp;n=507846" style="font-style: italic;
http://www.amazon.com/exec/obidos/ASIN/088385807X/ref=pd_sxp_elt_l1/t/002-7200940-4079202
http://www.amazon.com/exec/obidos/ASIN/0486694151/ref=pd_sxp_elt_l1/t/002-7200940-4079202
http://www.amazon.com/exec/obidos/ASIN/0486695735/ref=pd_sxp_elt_l1/t/002-7200940-4079202
http://www.amazon.com/exec/obidos/ASIN/0691023565/ref=pd_sxp_elt_l1/t/002-7200940-4079202

答案 1 :(得分:0)

解析html并提取&lt; a&gt;标签。然后找到href属性。如果你有那些,你可以选择保留哪些和放弃哪些。