Python filter/remove URLs from a list

Posted by Eef on Stack Overflow See other posts from Stack Overflow or by Eef
Published on 2008-11-03T11:34:18Z Indexed on 2010/06/18 2:53 UTC
Read the original article Hit count: 337

Filed under:
|
|
|
|

Hi.

I have a text file of URLs, about 14000. Below is a couple of examples:

http://www.domainname.com/pagename?CONTENT_ITEM_ID=100&param2=123
http://www.domainname.com/images?IMAGE_ID=10
http://www.domainname.com/pagename?CONTENT_ITEM_ID=101&param2=123
http://www.domainname.com/images?IMAGE_ID=11
http://www.domainname.com/pagename?CONTENT_ITEM_ID=102&param2=123

I have loaded the text file into a Python list and I am trying to get all the URLs with CONTENT_ITEM_ID separated off into a list of their own. What would be the best way to do this in Python?

Cheers

© Stack Overflow or respective owner

Related posts about python

Related posts about beginner