Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Xpath used twice doesn't work #84

Closed
nicosomb opened this issue Mar 13, 2017 · 1 comment
Closed

Xpath used twice doesn't work #84

nicosomb opened this issue Mar 13, 2017 · 1 comment

Comments

@nicosomb
Copy link
Collaborator

For mobile.twitter.com configuration, I want to do this:

title: (//div[contains(@class, 'TweetDetail-text') or contains(@class, 'tweet-text')])[1]
author: (//*[contains(@class, 'UserNames-displayName') or contains(@class, 'fullname')])[1]
body: (//div[contains(@class, 'TweetDetail-text') or contains(@class, 'tweet-text')])[1]
date: (//div[contains(@class, 'TweetDetail-timeAndGeo') or contains(@class, 'metadata')])[1]

I have the same xpath for title and body.
But the content is OK only for the title.
The body is wrong.

Do you have any idea?

@j0k3r
Copy link
Owner

j0k3r commented Mar 13, 2017

Once found the title is removed from the body to avoid being duplicated in the body.
https://github.com/j0k3r/graby/blob/master/src/Extractor/ContentExtractor.php#L247

@j0k3r j0k3r closed this as completed Mar 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants