FuturePythonWizard
FuturePythonWizard

Reputation: 43

Closing webkit_server at end of python program

I have been trying to figure this out for a couple of days, without success. In my program I'm using dryscrape to scrape some info from a website being rendered with JavaScript. When I run the program dryscrape automatically opens webkit_server to scrape the website but when the program is done it doesn't close webkit_server. Is there a function I can run at the end of my program to automatically close webkit_server? I'm on mac by the way, in python 3.6 and using dryscrape 1.01 along with qt 5.5. Here is my full dryscrape code:

import dryscrape
import bs4 as bs
url = ("http://www.foxsports.com/mlb/scores")
session = dryscrape.Session()
session.visit(url)
dsire_get = session.body()
soup = bs.BeautifulSoup(dsire_get, 'lxml')
for el in soup.find_all("div", class_="wisbb_name"):
    print(el.get_text())

After that loop would be when I'd want to close webkit_server.

Upvotes: 1

Views: 102

Answers (0)

Related Questions