I have to figure out a way to return the titles of all the articles on the front page of slashdot.org within 72 hours. I really have no idea where to even begin, any suggestions?
我必须找到一种方法,在72小时内返回slashdot.org首页上所有文章的标题。我真的不知道从哪里开始,有什么建议吗?
1 个解决方案
#1
- Open Slashdot.org
- Right-click on headline and select "Inspect element" (Chrome)
- Do this again with another headline
- Check for similarities in html-code (like classes)
- Loop through all elements with same class and write them to an array
- Write a function that loops through that array and returns each element of the array
右键单击标题并选择“Inspect element”(Chrome)
用另一个标题再次这样做
检查html代码中的相似之处(如类)
遍历具有相同类的所有元素并将它们写入数组
编写一个循环遍历该数组的函数,并返回该数组的每个元素
#1
- Open Slashdot.org
- Right-click on headline and select "Inspect element" (Chrome)
- Do this again with another headline
- Check for similarities in html-code (like classes)
- Loop through all elements with same class and write them to an array
- Write a function that loops through that array and returns each element of the array
右键单击标题并选择“Inspect element”(Chrome)
用另一个标题再次这样做
检查html代码中的相似之处(如类)
遍历具有相同类的所有元素并将它们写入数组
编写一个循环遍历该数组的函数,并返回该数组的每个元素