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

Pagination with Login #2

Open
JZL opened this issue Feb 7, 2015 · 4 comments
Open

Pagination with Login #2

JZL opened this issue Feb 7, 2015 · 4 comments

Comments

@JZL
Copy link

JZL commented Feb 7, 2015

Maybe this is specific to the site I am crawling but if a paginate a website after logging in, it loses the login (cookies/session I assume) on each successive new page

@matthewmueller
Copy link
Member

Oh interesting, could you provide some psuedocode for context?

@JZL
Copy link
Author

JZL commented Feb 7, 2015

xray('URL')
    .use(phantom())
//login(page # 1 )
    .wait("#barcodeOrUsername")
    .type('#barcodeOrUsername', 'USNER')
    .type("#password", "PASS")
    .click('input[type="submit"]')

//need to click a link, to get to pagination(page # 2)
    .wait(".menu-option-level-2")
    .click("a[href='/Mobile/MyAccount/ItemsOut']")
    .wait("table")


    .select("title")
    .paginate("#main > div > a:last-child[href]")
    .write(process.stdout)

The title is the right the first time, the logged clicked through page, but the next stdout is back to the page # 2

@areida
Copy link

areida commented Apr 29, 2015

I was having this exact same error today. For me the issue was that nightmare doesn't store cookies by default, you have to configure a path in the options.

.use(phantom({
    cookiesFile : '/path/to/cookies'
}))

@JZL
Copy link
Author

JZL commented Apr 29, 2015

I feel like that is probably where the error is but it doesn't work.

Thanks, though

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

3 participants