Open imedox opened 1 year ago
Have you tested this?
On Wed, 21 Jun 2023 at 16:16, Swapnil Soni @.***> wrote:
Have you tested this?
— Reply to this email directly, view it on GitHub https://github.com/itsmaarouf/bls-appointment-scripts-helper/issues/9#issuecomment-1601034474, or unsubscribe https://github.com/notifications/unsubscribe-auth/BATNXBFLLLOGNACGKV2ASR3XMMF37ANCNFSM6AAAAAAYSI3AVE . You are receiving this because you are subscribed to this thread.Message ID: @.*** com>
No dates were today in the morning I wasn't ready
@imedox okay but does it parses the open dates ?
On Wed, 21 Jun 2023 at 19:18, Swapnil Soni @.***> wrote:
@imedox https://github.com/imedox okay but does it parses the open dates ?
— Reply to this email directly, view it on GitHub https://github.com/itsmaarouf/bls-appointment-scripts-helper/issues/9#issuecomment-1601357719, or unsubscribe https://github.com/notifications/unsubscribe-auth/BATNXBFEQEM4FUGUL4U2QEDXMM3GJANCNFSM6AAAAAAYSI3AVE . You are receiving this because you are subscribed to this thread.Message ID: @.*** com>
I didn’t try because in the morning when appointments were opened I wasn’t the computer operator because I was out of the house
Mod DZ Active : salam 3alikoum, ana dert portage ta3 code ta3 habibna Hamza barek, te9der tmodifieh kima t7ab.
Mod DZ Disables : The Answer it should be!
salem alykoum khawti khasni script ta3 bls algerie allah y7fadkoum
@imedox SVP nouveau script BLS ALGER
Dsl kyo, j'ai abandonné ce projet.
Pourquoi Abandonné il est tres actif
Djugurta DJOUDER
Technicien Supérieur en Maintenance des Systèmes Informatiques Infographe & Designer
Golden Passementerie Louahadj Abdelaziz
Atelier Fabrication des rubans
Haouche Mourad grand foret 03 groupe 964 reghaia 16063 Alger
Mob : 0661 80 44 49 – @.***
E-mail : @. - @.
Le mar. 10 oct. 2023 à 14:42, imedox @.***> a écrit :
Dsl kyo, j'ai abandonné ce projet.
— Reply to this email directly, view it on GitHub https://github.com/itsmaarouf/bls-appointment-scripts-helper/issues/9#issuecomment-1755455450, or unsubscribe https://github.com/notifications/unsubscribe-auth/BDDSAUN3UOKCIAHTT7P5SUDX6VGDNAVCNFSM6AAAAAAYSI3AVGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONJVGQ2TKNBVGA . You are receiving this because you commented.Message ID: @.***>
*****
pip install requests beautifulsoup4
*****
- The code uses the requests library to make HTTP requests and the BeautifulSoup library for HTML parsing. It retrieves the web page, extracts the necessary information from the HTML, and performs actions based on the extracted data. It also handles updating form fields and submitting the form.
*****
- Make sure to replace 'YOUR_URL' in the url variable with the actual URL you want to use. Additionally, install the necessary libraries if not already installed: requests, bs4 (BeautifulSoup), pyperclip, and playsound.
*****
- The code will first check if there is a problem loading the page based on the title. If there is a problem, it will refresh the page and try again. If there is no problem loading, it will check if the specified element is present. If the element is found, it will process it accordingly. Otherwise, it will refresh the page.
*****
import requests from bs4 import BeautifulSoup import time import pyperclip from playsound import playsound
def main(): url = 'YOUR_URL' time_delay = 1 # in seconds
def get_web_page(url): headers = { 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.81 Safari/537.36' } response = requests.get(url, headers=headers) return response.text
def extract_title(html): soup = BeautifulSoup(html, 'html.parser') return soup.title.text.strip() if soup.title else ''
def is_problem_loading_page(title):
List of titles indicating a problem loading the page
def is_element_present(html): soup = BeautifulSoup(html, 'html.parser')
Check if the specified element is present
def process_element(html):
Rest of your code for processing the element
def extract_table_code(html): soup = BeautifulSoup(html, 'html.parser') script_tags = soup.find_all('script')
def extract_date_from_table(table): bgn = table.find('available_dates') + 20 end = table.find('fullCapicity_dates') - 9 table_code = table[bgn:end] return table_code[:10] if table_code else ''
def format_date_for_input(datee): if datee: dd = datee[0:2] mm = datee[3:5] yyyy = datee[6:10] return '-'.join([yyyy, mm, dd])
def get_input_value(html, input_id): soup = BeautifulSoup(html, 'html.parser') input_element = soup.find('input', {'id': input_id}) return input_element.get('value') if input_element else ''
def update_input_value(url, input_id, value): payload = { input_id: value } headers = { 'Content-Type': 'application/x-www-form-urlencoded' } response = requests.post(url, data=payload, headers=headers)
def is_payment_page(html): soup = BeautifulSoup(html, 'html.parser') return soup.find(id='print') is not None
def extract_payment_token(html): soup = BeautifulSoup(html, 'html.parser') token_input = soup.find('input', {'name': 'paymentLinkToken'}) return token_input['value'] if token_input else ''
def generate_payment_url(token): payment_url = f"https://payment.cmi.co.ma/fim/paymentLinkService?token={token}" return payment_url
def copy_to_clipboard(text): pyperclip.copy(text) print("Copied URL to clipboard")
def play_alert_sound(html): soup = BeautifulSoup(html, 'html.parser') if soup.select('.day.activeClass'): playsound('https://www.soundjay.com/mechanical/sounds/smoke-detector-1.mp3')
if name == 'main': main()