I have looked through stackoverflow and am unable to find the answer I am looking for, or understand if the answer given by another post is the answer I am looking for.
So what I would like to do is pull from a webpage, that has an input box, enter data into that input box, and get the return result.
What is a way I can go about doing this with Python? I saw someone created a similar scraper using json or Node I believe. But again I would like to use Python if that is doable.
right now I have the follow code
from bs4 import BeautifulSoup
import requests
source = requests.get('https://somewebsitehere.org').text
soup = BeautifulSoup(source, 'lxml')
receipt_box = soup.find('div', class_='filed-box')
print(receipt_box)
which gives me this
<div class="filed-box">
<input class="form-control textbox initial-
focus" id="receipt_number" maxlength="13"
name="appReceiptNum" type="text"/>
</div>
I think I need to use the appReceiptNum and from there enter my "receipt_number" into the input box.
I saw that Postpy2 may be able to help me with this but I don't really know.
any help is appreciated.
EDIT: So using Selenium this is what I have as an idea for accessing and send the desired info.
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.by import By
driver = webdriver.Chrome('PATH to my chromedriver.exe')
driver.get("https://egov.uscis.gov/casestatus/landing.do")
elem = driver.find_element(By.NAME, "appReceiptNum")
elem.send_keys("case number")
How does this look? I haven't gotten to sending the information yet.