Skip to content

Commit

Permalink
strictly select the 2nd (eq(1)) link in Facebook post HTML
Browse files Browse the repository at this point in the history
  • Loading branch information
mlsteele committed Jan 16, 2017
1 parent 1b1e35f commit 0a6c5e9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
4 changes: 2 additions & 2 deletions go/pvl/hardcoded.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,9 @@ var hardcodedPVLString = `
"Could not find link text in Facebook's response"
],
"into": "link_text",
"multi": true,
"selectors": [
"div.userContent+div a"
"div.userContent+div a",
1
]
}
},
Expand Down
9 changes: 4 additions & 5 deletions pvl-tools/pvl.cson
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,11 @@ services:

# This query operates on the newly extractaparsed comment, not the original page load
# This is the selector for the post attachment links, which contains the
# proof text. It's the "<a> tags inside the div that's the immediate
# *sibling* of the 'userContet' div". The second of these three <a> tags
# contains the proof text, the others are blank. But we just check their concatenation.
# proof text. It's the second <a> tag inside the div that's the immediate
# *sibling* of the 'userContet' div. The second of these three <a> tags
# contains the proof text, the others are blank. We check only the second.
{ selector_css: {
, selectors: ["div.userContent+div a"]
, multi: true
, selectors: ["div.userContent+div a", 1]
, into: "link_text"
, error: ["FAILED_PARSE", "Could not find link text in Facebook's response"] } },
{ whitespace_normalize: {
Expand Down

0 comments on commit 0a6c5e9

Please sign in to comment.