import requests
from bs4 import BeautifulSoup
USERNAME = '123'
PASSWORD = '213'
LOGIN_URL = 'https://naurok.com.ua/login'
TEST_URL = 'https://naurok.com.ua/test/monotonnist-i-neperervnist-funkci-parni-ta-neparni-funkci-1059187.html/print'
with requests.Session() as session:
login_resp = session.get(LOGIN_URL) #куки, реферер
login_resp = session.post(LOGIN_URL, data={'email': USERNAME, 'password': PASSWORD})
info_resp = session.get(TEST_URL)
print(info_resp.text)
url = 'https://naurok.com.ua/test/monotonnist-i-neperervnist-funkci-parni-ta-neparni-funkci-1059187.html'
response = requests.get(url)
soup = BeautifulSoup(response.text, 'lxml')
quotes = soup.find_all('a', class_='test-action-button')
for link in soup.find_all('a', class_='test-action-button'):
linkresult = (link.get('href'))
if linkresult:
urlresult = url + '/print'
responseresult = requests.get(urlresult)
soupresult = BeautifulSoup(response.text, 'lxml')
quotesresult = soup.find_all('div', class_='answer-key')
print(quotesresult)
import requests
from bs4 import BeautifulSoup
USERNAME = 'myuser'
PASSWORD = 'mypass'
URL = 'https://naurok.com.ua/login'
payload = {'email': USERNAME, 'password': PASSWORD}
session = requests.session()
r = requests.post(URL, data=payload)
account = session.get('https://naurok.com.ua/test/monotonnist-i-neperervnist-funkci-parni-ta-neparni-funkci-1059187.html/print')
print (account.content)
import requests
from bs4 import BeautifulSoup
USERNAME = 'myuser'
PASSWORD = 'mypass'
URL = 'https://naurok.com.ua/login'
payload = {'email': USERNAME, 'password': PASSWORD}
session = requests.session()
r = requests.post(URL, data=payload)
account = session.get('https://naurok.com.ua/test/monotonnist-i-neperervnist-funkci-parni-ta-neparni-funkci-1059187.html/print')
print (account.text)
url = 'https://naurok.com.ua/test/monotonnist-i-neperervnist-funkci-parni-ta-neparni-funkci-1059187.html'
response = requests.get(url)
soup = BeautifulSoup(response.text, 'lxml')
quotes = soup.find_all('a', class_='test-action-button')
for link in soup.find_all('a', class_='test-action-button'):
linkresult = (link.get('href'))
if linkresult:
urlresult = 'https://naurok.com.ua' + linkresult
responseresult = requests.get(urlresult)
soupresult = BeautifulSoup(response.text, 'lxml')
quotesresult = soup.find_all('div', class_='answer-key')
print(quotesresult)
*html развертку сайта*
[]
Process finished with exit code 0
1. б (1 балів)
2. б (1 балів)
3. а (1 балів)
4. б (1 балів)
5. а (1 балів)
6. б (1 балів)
7. а (2 балів)
8. а (2 балів)
9. а (1 балів)
10. б (1 балів)
11. в (1 балів)
12. б (2 балів)
13. в (1 балів)
14. в (1 балів)
15. б г (2 балів)
16. б (1 балів)
17. а (1 балів)
18. д (1 балів)
import requests
from bs4 import BeautifulSoup
USERNAME = 'myuser'
PASSWORD = 'mypass'
URL = 'https://naurok.com.ua/login'
payload = {'email': USERNAME, 'password': PASSWORD}
session = requests.session()
r = requests.post(URL, data=payload)
account = session.get('https://naurok.com.ua/test/monotonnist-i-neperervnist-funkci-parni-ta-neparni-funkci-1059187.html/print')
print (account.text)
url = 'https://naurok.com.ua/test/monotonnist-i-neperervnist-funkci-parni-ta-neparni-funkci-1059187.html'
response = requests.get(url)
soup = BeautifulSoup(response.text, 'lxml')
quotes = soup.find_all('a', class_='test-action-button')
for link in soup.find_all('a', class_='test-action-button'):
linkresult = (link.get('href'))
if linkresult:
urlresult = url + '/print'
responseresult = requests.get(urlresult)
soupresult = BeautifulSoup(response.text, 'lxml')
quotesresult = soup.find_all('div', class_='answer-key')
print(urlresult)
import requests
from bs4 import BeautifulSoup
USERNAME = 'email'
PASSWORD = '123strong'
URL = 'https://naurok.com.ua/login'
payload = {'email': USERNAME, 'password': PASSWORD}
responseaccount = requests.get(URL)
soupaccount = BeautifulSoup(responseaccount.text, 'lxml')
quotesaccount = soupaccount.find_all('img', class_='profile-avatar')
session = requests.session()
r = requests.post(URL, data=payload)
account = session.get('https://naurok.com.ua/test/monotonnist-i-neperervnist-funkci-parni-ta-neparni-funkci-1059187.html/print')
print (quotesaccount)
import requests
USERNAME = 'email'
PASSWORD = '123strong'
LOGIN_URL = 'https://naurok.com.ua/login'
TEST_URL = 'https://naurok.com.ua/test/monotonnist-i-neperervnist-funkci-parni-ta-neparni-funkci-1059187.html'
with requests.Session() as session:
login_resp = session.get(LOGIN_URL) #куки, реферер
login_resp = session.post(LOGIN_URL, data={'email': USERNAME, 'password': PASSWORD})
info_resp = session.get(TEST_URL)
print(info_resp.text)
import requests
from bs4 import BeautifulSoup
url = 'https://naurok.com.ua/test/monotonnist-i-neperervnist-funkci-parni-ta-neparni-funkci-1059187.html'
response = requests.get(url)
soup = BeautifulSoup(response.text, 'lxml')
quotes = soup.find_all('a', class_='test-action-button')
for link in soup.find_all('a', class_='test-action-button'):
linkresult = (link.get('href'))
if linkresult:
urlresult = url + '/print'
responseresult = requests.get(urlresult)
soupresult = BeautifulSoup(response.text, 'lxml')
quotesresult = soup.find_all('div', class_='answer-key')
print(urlresult)
import requests
USERNAME = 'зарегайся, 2 минуты'
PASSWORD = 'зарегайся, 2 минуты'
LOGIN_URL = 'https://naurok.com.ua/login'
TEST_URL = 'https://naurok.com.ua/test/monotonnist-i-neperervnist-funkci-parni-ta-neparni-funkci-1059187.html/print'
with requests.Session() as session:
login_resp = session.get(LOGIN_URL) #куки, реферер
login_resp = session.post(LOGIN_URL, data={'email': USERNAME, 'password': PASSWORD})
info_resp = session.get(TEST_URL)
print(info_resp.text)
1. б (1 балів)
2. б (1 балів)
3. а (1 балів)
4. б (1 балів)
5. а (1 балів)
6. б (1 балів)
7. а (2 балів)
8. а (2 балів)
9. а (1 балів)
10. б (1 балів)
11. в (1 балів)
12. б (2 балів)
13. в (1 балів)
14. в (1 балів)
15. б г (2 балів)
16. б (1 балів)
17. а (1 балів)
18. д (1 балів)
19. б (1 балів)
20. г (1 балів)
21. б (1 балів)
[]
import requests
USERNAME = 'email@mail.ru'
PASSWORD = 'pwd'
LOGIN_URL = 'https://naurok.com.ua/login'
with requests.Session() as session:
login_resp = session.get(LOGIN_URL) #куки, реферер
login_resp = session.post(LOGIN_URL, data={'email': USERNAME, 'password': PASSWORD})
info_resp = session.get('https://naurok.com.ua/test/monotonnist-i-neperervnist-funkci-parni-ta-neparni-funkci-1059187.html')
#хочешь - сохраняешь
with open('res.html', 'wt', encoding='utf-8') as dst:
dst.write(info_resp.text)
#хочешь - парсишь как тебе нужно.