
17.10.2024, 03:14
|
|
Новичок
Регистрация: 17.10.2024
Сообщений: 1
С нами:
830353
Репутация:
1
|
|
/me пошёл на***.:
Код:
import
random
import
requests
from
bs4
import
BeautifulSoup
from
enum
import
Enum
class
Gender
(
Enum
)
:
MALE
=
"male"
FEMALE
=
"female"
class
Nation
(
Enum
)
:
RUSSIAN
=
"russian"
JAPANESE
=
"japanese"
ITALIAN
=
"italian"
LATINOS
=
"latinos"
FRENCH
=
"french"
SWEDISH
=
"swedish"
GERMAN
=
"german"
DANISH
=
"danish"
ROMANIAN
=
"romanian"
AMERICAN
=
"american"
def
generate_nick
(
gender
:
Gender
=
random
.
choice
(
list
(
Gender
)
)
,
nation
:
Nation
=
random
.
choice
(
list
(
Nation
)
)
,
name
:
str
=
''
,
surname
:
str
=
''
,
)
-
>
str
:
response
=
requests
.
get
(
'http://rp-nicks.aa-roleplay.ru/index.php'
,
params
=
{
'gender'
:
gender
.
value
,
'nation'
:
nation
.
value
,
'name'
:
name
,
'surname'
:
surname
}
)
response
.
raise_for_status
(
)
soup
=
BeautifulSoup
(
response
.
text
,
'lxml'
)
return
soup
.
find
(
'textarea'
)
.
text
|
|
|