
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN: 9780133594140
Author: James Kurose, Keith Ross
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Question
Complete the Python program below to extract and display all the image links from the URL below.
from urllib.request import urlopen
from bs4 import BeautifulSoup
import re
#html = urlopen('https://baruch.cuny.edu/')
html = urlopen('https://bctc.baruch.cuny.edu/')
bs = BeautifulSoup(html, 'html.parser')
images = #TO DO -- Complete the Code
for image in images:
print(image['src']+'\n')
Expert Solution

arrow_forward
Python Code
from urllib.request import urlopen
from bs4 import BeautifulSoup
import re
html = urlopen('https://baruch.cuny.edu/')
bs = BeautifulSoup(html, 'html.parser')
images = bs.find_all('img', {'src':re.compile('.jpg')})
for image in images:
print(image['src']+'\n')
Trending nowThis is a popular solution!
Step by stepSolved in 3 steps with 2 images

Knowledge Booster
Similar questions
- The login.html image is shown below. The simple PHP module shows email and password fields for a user to enter. Analyze the code and identify one issue with the code regarding security. Explain the problem by identifying the line no. and provide the corrected line of code. login.html 1 2 3 4 5 6 7 8 9 10 11 12 13 14 Login Form Login Email Address: Password: 15 16 17arrow_forwardIn this project you will use selection lists to store long lists of hypertext links that might overwhelm a page if displayed within a navigation list. The name of a linked page is displayed as the text of a selection list option while the URL is stored as that option's value. By selecting an item from one of the selection list options, the browser will open the web page with that selected URL. To script this action, you will use the event object. One of the properties associated with the event object is as follows: evt.target where evt is the variable name assigned to event object and target is the object that received the event. In this project the target is the option selected by the user from one of the selection lists. The event will be the change event. A preview of the page is shown in Figure 6-39arrow_forwardCopy-paste code below and save it as XHTML (with extension .xhtml). Fix as many errors in the code as you can. Note: ignore the <code> tag, it was included for the proper listing purposes <code> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"></html> <!DOCTYPE html > <P>This is my first paragraph on a page<P> This Midterm is a nightmare <img src=profile.jpg alt=My Professor width=200 height= 136 border= 1 > <br> <b><I>So hard exam!<I></Ib> </code> Initial screen:arrow_forward
Recommended textbooks for you
- Computer Networking: A Top-Down Approach (7th Edi...Computer EngineeringISBN:9780133594140Author:James Kurose, Keith RossPublisher:PEARSONComputer Organization and Design MIPS Edition, Fi...Computer EngineeringISBN:9780124077263Author:David A. Patterson, John L. HennessyPublisher:Elsevier ScienceNetwork+ Guide to Networks (MindTap Course List)Computer EngineeringISBN:9781337569330Author:Jill West, Tamara Dean, Jean AndrewsPublisher:Cengage Learning
- Concepts of Database ManagementComputer EngineeringISBN:9781337093422Author:Joy L. Starks, Philip J. Pratt, Mary Z. LastPublisher:Cengage LearningPrelude to ProgrammingComputer EngineeringISBN:9780133750423Author:VENIT, StewartPublisher:Pearson EducationSc Business Data Communications and Networking, T...Computer EngineeringISBN:9781119368830Author:FITZGERALDPublisher:WILEY

Computer Networking: A Top-Down Approach (7th Edi...
Computer Engineering
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:PEARSON

Computer Organization and Design MIPS Edition, Fi...
Computer Engineering
ISBN:9780124077263
Author:David A. Patterson, John L. Hennessy
Publisher:Elsevier Science

Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:9781337569330
Author:Jill West, Tamara Dean, Jean Andrews
Publisher:Cengage Learning

Concepts of Database Management
Computer Engineering
ISBN:9781337093422
Author:Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:Cengage Learning

Prelude to Programming
Computer Engineering
ISBN:9780133750423
Author:VENIT, Stewart
Publisher:Pearson Education

Sc Business Data Communications and Networking, T...
Computer Engineering
ISBN:9781119368830
Author:FITZGERALD
Publisher:WILEY