Answer the question
In order to leave comments, you need to log in
How to pass a variable (value) to a python function?
Hello ! I have a function that stores this variable in itself. And the link
variable stores the results of links. And I need to pass the value of the variable to another function
. Here is the function itself:
def get_links(html):
soup = BeautifulSoup(html, 'lxml')
links=soup.findAll(link_container_array[0],{link_container_array[1]:link_container_array[2]})
for link_container in links:
a_tag = link_container .find("a")
# Если нашел
if a_tag:
link = resource_allnews_link + a_tag.get("href")
return link
link
def get_content(html):
soup = BeautifulSoup(html,'lxml')
page_url=soup.find(page_link[0],{page_link[1]:page_link[2]})
print(page_url)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question