Import scrapper python file in spacy program

I created a web scrapper on python to extract text from a wikipedia page:

Scarapper.py

from bs4 import BeautifulSoup
import requests

source = requests.get('https://en.wikipedia.org/wiki/wills').text
soup = BeautifulSoup(source,'lxml')

heading = soup.find('h1',{'id':'firstHeading'}).text
print(heading)
print()

date = soup.find("span",{"class":"mw-headline","id":"1847_to_1901"}).text
print(date)
print()

for item in soup.select("#mw-content-text"):
    required_data = [p_item.text for p_item in item.select("p")][3:6]
    print('\n'.join(required_data))

I want to create a python program using SPACY package to extract entities from the text generated from above scrapper.py.

Spacy_entity.py

import spacy

entity_list = []

nlp = spacy.load("en_core_web_sm")

text = ?

doc = nlp(text)

for entity in doc.ents:
    entity_list.append((entity.text, entity.label_))
print(entity_list)

How to use text such that it takes from scrapper.py and gives the array of entities of text.