{"id":28640660,"url":"https://github.com/neurobin/phantomjspy","last_synced_at":"2025-06-12T20:08:00.210Z","repository":{"id":50880129,"uuid":"224668382","full_name":"neurobin/phantomjspy","owner":"neurobin","description":"Python wrapper for phantomjs","archived":false,"fork":false,"pushed_at":"2021-05-28T05:18:27.000Z","size":40,"stargazers_count":15,"open_issues_count":1,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-05-22T05:45:28.239Z","etag":null,"topics":["phantomjs","phantomjs-script","python"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/neurobin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"patreon":"neurobin","liberapay":"neurobin","ko_fi":"neurobin","issuehunt":"neurobin","open_collective":"neurobin","otechie":"neurobin"}},"created_at":"2019-11-28T14:16:24.000Z","updated_at":"2023-06-15T09:52:21.000Z","dependencies_parsed_at":"2022-08-28T05:20:31.005Z","dependency_job_id":null,"html_url":"https://github.com/neurobin/phantomjspy","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/neurobin/phantomjspy","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neurobin%2Fphantomjspy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neurobin%2Fphantomjspy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neurobin%2Fphantomjspy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neurobin%2Fphantomjspy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/neurobin","download_url":"https://codeload.github.com/neurobin/phantomjspy/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neurobin%2Fphantomjspy/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259522113,"owners_count":22870449,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["phantomjs","phantomjs-script","python"],"created_at":"2025-06-12T20:07:58.996Z","updated_at":"2025-06-12T20:08:00.188Z","avatar_url":"https://github.com/neurobin.png","language":"Python","funding_links":["https://patreon.com/neurobin","https://liberapay.com/neurobin","https://ko-fi.com/neurobin","https://issuehunt.io/r/neurobin","https://opencollective.com/neurobin","https://otechie.com/neurobin"],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/neurobin/phantomjspy.svg?branch=release)](https://travis-ci.org/neurobin/phantomjspy)\n\nPhantomJS wrapper in Python\n\n# Pre requisites\n\n1. **phantomjs:** `phantomjs` command line tool.\n2. **Python 3**\n\n# Install\n\n```bash\npip install phantomjs\n```\n\n# Usage\n\n## Using with a custom phantomjs script:\n\n```python\n\nfrom phantomjs import Phantom\n\nphantom = Phantom()\n\nconf = {\n    'url': 'http://example.com/',   # Mandatory field\n}\noutput = phantom.download_page(conf, js_path='/my/phantomjs/script/path')\n```\n\nIn your phantomjs script, you can take the url as:\n\n```javascript\nvar system = require('system');\nvar json = JSON.parse(system.args[1]);\nvar url = json.url;\n```\n\n## Using the default phantomjs script provided with this package:\n\n```python\n\nfrom phantomjs import Phantom\n\nphantom = Phantom()\n\nconf = {\n    'url': 'http://example.com/',   # Mandatory field\n    'output_type': 'html',          # json for json\n    'min_wait': 1000,               # 1 second\n    'max_wait': 30000,              # 30 seconds\n    'selector': '',                 # CSS selector if there's any\n    'resource_timeout': 3000,       # 3 seconds\n    'headers': {\n        \"User-Agent\": \"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.72 Safari/537.36\",\n        \"Accept\": \"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3\",\n        \"Sec-Fetch-Mode\": \"navigate\",\n        'Sec-Fetch-Site': 'same-origin',\n        'Upgrade-Insecure-Requests': '1',\n    },\n    'cookies': [\n        {'name': '_Country', 'value': 'US', 'domain': '.google.com',},\n        {'name': '_Currency', 'value': 'USD', 'domain': '.google.com',},\n    ],\n    'functions': [\n        'function(){window.location.replace(\"http://icanhazip.com/\");}',\n    ],\n}\n\n\noutput = phantom.download_page(conf)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneurobin%2Fphantomjspy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fneurobin%2Fphantomjspy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneurobin%2Fphantomjspy/lists"}