resolved the new path of the target web page

resolved the new path of the target web page
pull/13962/head
mir.zhou 2022-04-07 03:21:09 +08:00 committed by GitHub
parent c9dcdf6744
commit 790fd88e16
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -15,8 +15,8 @@ fn main() {
// html.DocumentObjectModel.get_tag_by_attribute_value() retrieves all the tags in the document that has the given attribute name and value.
tags := doc.get_tag_by_attribute_value('class', 'list_article_item')
for tag in tags {
href := tag.children[0].attributes['href'] or { panic('key not found') }
title := tag.children[0].attributes['title'] or { panic('key not found') }
href := tag.children[1].children[0].children[0].children[0].attributes['href'] or { panic('key not found') }
title := tag.children[1].children[0].children[0].children[0].attributes['title'] or { panic('key not found') }
println('href: $href')
println('title: $title')
println('')