Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialMichael Strand
10,897 PointsFinding Internal Links Without .html
Hi,
How would you go about finding internal links that have a URL structure like https://www.website.com/about-us
?
2 Answers
Steven Parker
231,275 PointsAccording to the documentation, "find" always returns just one result. To get a list of all matching items, use "find_all" instead.
Michael Strand
10,897 PointsI did try that and it just returned errors. If I follow the video it uses find
but looks for the extension .html
and returns multiple results.
Steven Parker
231,275 PointsI'm confused. I don't have experience with it myself, but unless I'm reading the docs wrong, they seem to state explicitly that "find" only returns one item.
Michael Strand
10,897 PointsYes, I was confused as well. I don't quite understand how that worked as well.
Michael Strand
10,897 PointsMichael Strand
10,897 PointsThis is my starting point, but this only returns one url.