Course-table | 微信小程序,课程表最佳实践案例。 | Chat library
kandi X-RAY | Course-table Summary
kandi X-RAY | Course-table Summary
微信小程序,课程表最佳实践案例。
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of Course-table
Course-table Key Features
Course-table Examples and Code Snippets
Community Discussions
Trending Discussions on Course-table
QUESTION
I am new to Python and I am using beautiful soup to do an assignment about web scraping. The user is asked to input the units of the course. And I should pull out the relevant information about the course including the course title, time, registered students and instructor.
I started with finding the course table which contains all courses information and each course is in a table udder the course table tag. Then I would like to iterate and loop through each course to find out the information. But the code I wrote does not give me anything.
Could anyone take a look at my code? Which part did I do wrong? Thank you in advance. The html link is http://classes.usc.edu/term-20181/classes/itp/ The following is my code to ask for user input and I am trying to use find & find_all function to find the class title,time,students registered and instructor.
...ANSWER
Answered 2018-Mar-25 at 18:22There are several things in your code that are not working:
The class you use for finding the courses tables course-info expanded
does not exists until you click in a course, so you have to use course-info expandable
.
Second, you are asking the user for an input of the number of units, but you are extracting the units
text which is in a format (#.# units)
, so you need to account for that too.
Lastly, in your for loop
, you need to access the properties of the course
object, and not courses
.
This gives the output you want:
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install Course-table
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page