2024-06-13 14:18:41 +00:00
|
|
|
import allure
|
|
|
|
import requests
|
2024-05-31 10:45:47 +00:00
|
|
|
import webbrowser
|
|
|
|
|
2024-06-13 14:18:41 +00:00
|
|
|
from bs4 import BeautifulSoup
|
2024-05-31 10:45:47 +00:00
|
|
|
|
|
|
|
|
2024-06-13 14:18:41 +00:00
|
|
|
@allure.step('Open link in default browser')
|
2024-05-31 10:45:47 +00:00
|
|
|
def open_link(url):
|
|
|
|
webbrowser.open(url)
|
|
|
|
|
|
|
|
|
2024-06-13 14:18:41 +00:00
|
|
|
@allure.step('Get response')
|
2024-05-31 10:45:47 +00:00
|
|
|
def get_response(url):
|
|
|
|
response = requests.get(
|
|
|
|
url)
|
|
|
|
return response
|
2024-06-13 14:18:41 +00:00
|
|
|
|
|
|
|
|
|
|
|
@allure.step('Get page content')
|
|
|
|
def get_page_content(url):
|
|
|
|
request = requests.get(url)
|
|
|
|
src = request.text
|
|
|
|
soup = BeautifulSoup(src, 'html.parser')
|
|
|
|
return soup
|