Question
Can I get some help(code) for this lab due today please? The lab is in PYTHON Web pages are written in text, using a language
Can I get some help(code) for this lab due today please? The lab is in PYTHON
Web pages are written in text, using a language called Hypertext Markup Language, almost always abbreviated to HTML. We will learn something about HTML as the semester goes on, but for this week, you can just think of a web page being a (often very large) string.
If you like, you can look at the text of a web page you are browsing:
In Chrome, View-->>Developer-->View Source
In Firefox, Tools-->Web Developer-->Page Source
In Safari, Develop-->Show Page Source
If you dont see the Develop menu in Safari, click Safari in the menu bar, choose Preferences, then click Advanced. Select Show Develop menu in menu bar.
In a web page's HTML source, each link to another page is signaled by text that begins with the symbols:
The first character is a left angle bracket, and the last character is an equal sign. The next thing after that that is inside (standard double) quotation marks is the web address, or Uniform Resource Locator almost always abbreviated to URL of the page.
Thus a link in a page's HTML to the UIC Computer Science web page would start:
URL Lab Assignment
Write and submit a function called get_url() that takes one string as input and returns the text of the first URL in the string, treating it as proper HTML, or -1 if there is no URL.
You are to return exactly the the text of the URL, that is, the string you could enter into the address field of a web browser. So, if
s = 'UIC CS'
get_url(s) should return the string: "https://www.cs.uic.edu/"
Likely useful tools: find, slicing, if
Important note: You must:
Put a docstring in every function
Use meaningful variable names throughout (except that you may use 1-letter variable names for formal parameters and/or loop control variables).
We will be giving some of the points for this.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started