Paginated Title Collector
Simulate scraping 3 pages of results, collecting every title (using a CSS selector, like the notes' own pagination example) into a single combined list.
Approach: for each of 3 given "pages" (a comma-separated line of titles standing in for that page's HTML), build a small local page, use soup.select(".title") to pull out its titles, and extend one running list across all 3 pages.
Input: Three lines, one per page: a comma-separated list of titles appearing on that page.
Output: One line: every title collected across all 3 pages, in page order, printed as a Python list.
A,B C,D E
['A', 'B', 'C', 'D', 'E']
- Each page has at least 1 title.
Hint 1
soup.select(".title") uses CSS selector syntax to find every element with class="title".
Hint 2
Loop 3 times (once per page), extending the same all_titles list each time rather than replacing it.
Hint 3
all_titles.extend(page_result) adds every item from page_result onto the end of all_titles.
Each of the 3 pages is built into its own tiny local HTML page (one <span class="title"> per title on that page), then soup.select(".title") extracts that page's titles using CSS selector syntax, exactly like the notes' pagination loop. Extending — not replacing — all_titles on each iteration is what collects titles from all 3 pages into one combined, in-order list.