Update extract.py
Browse files- extract.py +9 -1
extract.py
CHANGED
@@ -133,6 +133,8 @@ def get_vehicle_info(driver, plate_number: str):
|
|
133 |
driver.get("https://www.jambisamsat.net/infopkb.html")
|
134 |
time.sleep(1)
|
135 |
|
|
|
|
|
136 |
WebDriverWait(driver, 10).until(
|
137 |
EC.presence_of_element_located((By.ID, "no_polisi"))
|
138 |
)
|
@@ -144,11 +146,15 @@ def get_vehicle_info(driver, plate_number: str):
|
|
144 |
submit_button = driver.find_element(By.CSS_SELECTOR, 'button.btn.btn-primary[type="submit"]')
|
145 |
submit_button.click()
|
146 |
|
|
|
|
|
147 |
# Wait for the new page to load
|
148 |
WebDriverWait(driver, 10).until(
|
149 |
EC.url_contains("infopkb.php")
|
150 |
)
|
151 |
|
|
|
|
|
152 |
driver.implicitly_wait(3)
|
153 |
|
154 |
scroll_height = driver.execute_script("return document.body.scrollHeight")
|
@@ -159,8 +165,10 @@ def get_vehicle_info(driver, plate_number: str):
|
|
159 |
|
160 |
button = WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.ID, "show_det_swd")))
|
161 |
button.click()
|
|
|
|
|
162 |
|
163 |
-
time.sleep(
|
164 |
|
165 |
return scrape_vehicle(driver)
|
166 |
|
|
|
133 |
driver.get("https://www.jambisamsat.net/infopkb.html")
|
134 |
time.sleep(1)
|
135 |
|
136 |
+
print("[GET URL]")
|
137 |
+
|
138 |
WebDriverWait(driver, 10).until(
|
139 |
EC.presence_of_element_located((By.ID, "no_polisi"))
|
140 |
)
|
|
|
146 |
submit_button = driver.find_element(By.CSS_SELECTOR, 'button.btn.btn-primary[type="submit"]')
|
147 |
submit_button.click()
|
148 |
|
149 |
+
print("BUTTON CLICKED")
|
150 |
+
|
151 |
# Wait for the new page to load
|
152 |
WebDriverWait(driver, 10).until(
|
153 |
EC.url_contains("infopkb.php")
|
154 |
)
|
155 |
|
156 |
+
print("PHP LOADED")
|
157 |
+
|
158 |
driver.implicitly_wait(3)
|
159 |
|
160 |
scroll_height = driver.execute_script("return document.body.scrollHeight")
|
|
|
165 |
|
166 |
button = WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.ID, "show_det_swd")))
|
167 |
button.click()
|
168 |
+
|
169 |
+
print("SCRIPT EXECUTED")
|
170 |
|
171 |
+
time.sleep(1)
|
172 |
|
173 |
return scrape_vehicle(driver)
|
174 |
|