crawling a html page using php?

后端 未结 5 589
时光说笑
时光说笑 2020-12-03 23:38

This website lists over 250 courses in one list. I want to get the name of each course and insert that into my mysql database using php. The courses are listed like this:

5条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-04 00:36

    Just for fun, here's a quick shell script to do the same thing.

    curl http://courses.westminster.ac.uk/CourseList.aspx \
    | sed '/\(.*\)<\/td>/ { s/.*">\(.*\)<\/a>.*/\1/; b }; d;' \
    | uniq > courses.txt
    

提交回复
热议问题