View the step-by-step solution to:

Can I get help fixing, completing my python code?

Can I get help fixing, completing my python code?

Our program will open and read the urls contained in the file, and it will report back on the subset of urls that contain a reference to the specified topic.

I have included comments.


Screen Shot 2018-06-10 at 5.09.27 PM.png


#------------------------------------------

sources.txt file:

http://web.archive.org/web/20180307004551/https://foothill.edu/news/
http://web.archive.org/web/20151030182314/https://www.deanza.edu/news/
http://web.archive.org/web/20151030182406/http://blogs.sjsu.edu/newsroom/
http://web.archive.org/web/20151030182501/http://news.stanford.edu/
http://invalidurlurlcs21a.com/
http://web.archive.org/web/20151030182547/http://news.berkeley.edu/
http://web.archive.org/web/20151030182644/http://www.scu.edu/scunews/
http://web.archive.org/web/20151030172714/http://news.ucsc.edu/
http://web.archive.org/web/20151030183138/http://www.news.ucsb.edu/
http://web.archive.org/web/20151030183532/http://ucsdnews.ucsd.edu/
http://www.deanza.edu/counseling/documents/Substitution%20Petition.pdf

#------------------------------

EXAMPLE output

artsummary.txt file:

Source url:

http://web.archive.org/web/20151030182314/https://www.deanza.edu/news/

Euphrat Museum of Art

Chain link fence art installation explores civil liberties issues

Euphrat Museum of Art exhibition features two student projects

Source url:

http://web.archive.org/web/20151030183138/http://www.news.ucsb.edu/

Recent acquisitions by the Art, Design & Architecture Museum explore

narratives of art and architecture

art

--------------

Test case 1:

python aggregator.py sources.txt art

The following error messages should be generated:

Error opening url: http://invalidurlurlcs21a.com/


Error decoding url: http://www.deanza.edu/counseling/documents/Substitution%20Petition.pdf

'utf-8' codec can't decode byte 0xc4 in position 10: invalid continuation byte

The output file (artsummary.txt) should match the file artsummary.txt.

Make sure you pick up references to Art and art and make sure you do NOT pick up the reference to arts.

Make sure you pick up the reference to Art when it is followed by punctuation as in: Recent acquisitions by the Art, Design...

Screen Shot 2018-06-10 at 5.09.27 PM.png

Recently Asked Questions

Why Join Course Hero?

Course Hero has all the homework and study help you need to succeed! We’ve got course-specific notes, study guides, and practice tests along with expert tutors.

-

Educational Resources
  • -

    Study Documents

    Find the best study resources around, tagged to your specific courses. Share your own to gain free Course Hero access.

    Browse Documents
  • -

    Question & Answers

    Get one-on-one homework help from our expert tutors—available online 24/7. Ask your own questions or browse existing Q&A threads. Satisfaction guaranteed!

    Ask a Question