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

perform "session.open(url)" In linux Don't complain But it's not the result #324

Open
wh836627932 opened this issue Apr 12, 2017 · 1 comment

Comments

@wh836627932
Copy link

wh836627932 commented Apr 12, 2017

from ghost import Ghost
from ghost.ghost import HttpResource
from bs4 import BeautifulSoup

from ghost import Ghost
ghost = Ghost()

with ghost.start() as session:
    page, extra_resources = session.open("http://www.haoqu.net/player/mg8/v2.php?id=608807428")
    Soup = BeautifulSoup(unicode(session.content), 'html5lib')
    print Soup.find(id='myElement').find('a').get("href")

No question in my code on Windows But couldn't run in Linux

@EvaSDK
Copy link
Collaborator

EvaSDK commented Feb 16, 2018

Your link was broken so I had to pick another URL from this site.

from __future__ import print_function

import logging

from ghost import Ghost
from bs4 import BeautifulSoup

ghost = Ghost()
logging.basicConfig(level=logging.INFO)

with ghost.start() as session:
    page, extra_resources = session.open("http://www.haoqu.net/1/cctv5.html")
    Soup = BeautifulSoup(session.content, 'html5lib')
    print(Soup.find(id='bdshare').find('a').get("href"))

works just fine. Maybe you could expand your report with a traceback or logs ?

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