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

Segmentation fault for some particular websites

Open n-k-d opened this issue 10 years ago • 9 comments

For some websites, python is throwing segmentation fault:

2015-10-07T18:50:43.274Z [WARNING ] QT: QFont::setPixelSize: Pixel size <= 0 (0) 2015-10-07T18:50:43.310Z [WARNING ] QT: QFont::setPixelSize: Pixel size <= 0 (0) Segmentation fault: 11

Following is the test Script used:

from ghost import Ghost
ghost = Ghost()

with ghost.start() as session:
    session.show()
    page, extra_resources = session.open("http://ebay.com")
    session.show()
    session.wait_for_page_loaded()

Python Version : 2.7.10 (OS X Yosemite Version 10.10.3 (14D136))

n-k-d avatar Oct 07 '15 13:10 n-k-d

I can confirm the segmentation fault. Debian "testing" on amd64, Python 2.7.9 or 3.4.3, PySide 1.2.2.

ghost avatar Oct 07 '15 21:10 ghost

Can we open this web page without loading any image or css ? If yes , could you please tell me how ?

n-k-d avatar Oct 08 '15 06:10 n-k-d

@NKaushik89 you can use the exclude argument as shown here: https://github.com/jeanphix/Ghost.py/commit/127d2ab3cff54fcf804078fe78c319654ac375f2#diff-4d1bd3fdfc67d35993565f52590bd28fR449

session = ghost.start(exclude="\.(js|css)$")

jeanphix avatar Oct 08 '15 06:10 jeanphix

Thank you ~

After excluding js, (exclude=".(js)$") , it is working for some sites. With one error :

undefined(0): ReferenceError: Can't find variable: $

Also, cann't we use the following API's to fill form data ? :

session.set_field_value("input[name=username]", "username")

                                        AND

session.fill("form", {
           "username": "username",
           "password": "password",})

Confirmed : this issue is only with js enabled sites

n-k-d avatar Oct 08 '15 07:10 n-k-d

reproduce the same error, even i exclude the js and css files, the python will still crashed. #245

shinux avatar Oct 19 '15 03:10 shinux

I am facing the same issue although I am not excluding js and css. I need these files for my experiment.

Any quick fix for this?

Ashish1805 avatar Oct 20 '15 14:10 Ashish1805

@Ashish1805 I met the same question,I need data from JS,have you fix it?

direwolf1991 avatar Feb 16 '16 12:02 direwolf1991

I am having the exact same issue.

bmamouri avatar Sep 14 '16 12:09 bmamouri

After excluding js, (exclude=".(js)$") , it is working for some sites. With one error :

undefined(0): ReferenceError: Can't find variable: $

@NKaushik89 This is most likely because the website is using jQuery that you just forbid from downloading.

EvaSDK avatar Sep 22 '17 12:09 EvaSDK