This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## 6. Locate Elements By CSS Selector | |
<html> | |
<body> | |
<div class="round-button">Click Here</p> | |
</body> | |
<html> | |
div.round-button | |
get_div = driver.find_element_by_css_selector('div.round-button') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import aioschedule as schedule | |
import asyncio | |
from telethon import TelegramClient | |
with TelegramClient( | |
os.path.abspath(fileName), | |
config.getint("api", "api_id"), | |
config.get("api", "api_hash"), | |
connection_retries=15, | |
retry_delay=3, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
from telethon import TelegramClient, events | |
# sample API_ID from https://github.com/telegramdesktop/tdesktop/blob/f98fdeab3fb2ba6f55daf8481595f879729d1b84/Telegram/SourceFiles/config.h#L220 | |
# or use your own | |
api_id = 17349 | |
api_hash = '344583e45741c457fe1862106095a5eb' | |
# fill in your own details here |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#This is taken from https://github.com/LonamiWebs/Telethon-calls/blob/master/calls.py and modified | |
import hashlib | |
import os | |
import random | |
from pyrogram import Client | |
from pyrogram.api.functions.messages import GetDhConfig | |
from pyrogram.api.functions.phone import RequestCall | |
from pyrogram.api.types import PhoneCallProtocol |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def split_message(text, length=4096, offset=200): | |
return [text[text.find('\n', i - offset, i + 1) if text.find('\n', i - offset, i + 1) != -1 else i: | |
text.find('\n', i + length - offset, i + length) if text.find('\n', i + length - offset, | |
i + length) != -1 else i + length] for | |
i | |
in | |
range(0, len(text), length)] | |
# Usage, Using Pyrogram |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import re | |
def youtube_url_validation(url): | |
youtube_regex = (r'(https?://)?(www\.)?(youtube|youtu|youtube-nocookie)\.(com|be)/(playlist\?list=|embed/|v/|.\?)') | |
youtube_regex_match = re.match(youtube_regex, url) | |
if youtube_regex_match: | |
return "success" | |
return "error" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <conio.h> | |
int main() | |
{ | |
int r, c, k, m, i; | |
m = 26; | |
for (r = 1; r <= m - 1; r++) | |
{ | |
i = 0; | |
for (c = 1; c <= m - r; c++) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
/* Iterative function to reverse digits of num*/ | |
int reversDigits(int num) | |
{ | |
int rev_num = 0; | |
while (num > 0) | |
{ | |
rev_num = rev_num * 10 + num % 10; | |
num = num / 10; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <conio.h> | |
int main() | |
{ | |
int a; | |
float birler, onlar, yuzler; | |
printf("3 basamakli sayi girin: "); | |
scanf("%d", &a); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int isperfect(int input) | |
{ | |
int sum = 0, value = input / 2; | |
do | |
{ | |
if (input % value == 0) | |
sum += value; | |
value--; |
OlderNewer