0
0 комментариев

Версия Python 3.8
Ваша операционная система Windows
Библиотеки: BeautifulSoup4,requests

[apcode language=»python»]

import requests
from bs4 import BeautifulSoup as bs
import requests
      headers = {'accept': '*/*', 'user-agent': 'Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, l'}
 base_url = 'https://www.m-translate.ru/translator#text=ыфв&direction=ru-uk'
  def perevod(base_url, headers):
    session = requests.Session()
    request = session.get(base_url, headers=headers)
    if request.status_code == 200:
         text = input()
        r = requests.post(base_url, data={'text': text})
        answer = r.text
                 print(answer) 
                                                             perevod(base_url, headers)

[/apcode]

Asked question
Добавить комментарий