Ghost.py icon indicating copy to clipboard operation
Ghost.py copied to clipboard

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

Open wh836627932 opened this issue 7 years ago • 1 comments

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

wh836627932 avatar Apr 12 '17 04:04 wh836627932

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 ?

EvaSDK avatar Feb 16 '18 10:02 EvaSDK