clarkdave / dsacancellationchecker Goto Github PK
View Code? Open in Web Editor NEWA small Python script to scrape the DSA website to look for driving test cancellations
A small Python script to scrape the DSA website to look for driving test cancellations
Hi,
I seem to get this error half of the time:
[2013-06-03 @ 07:09]
---> Starting update...
---> Connecting to https://driverpracticaltest.direct.gov.uk/login
---> Connecting to https://driverpracticaltest.direct.gov.uk/login
-----> Sending data:
-------> username = XX
-------> password = XX
Traceback (most recent call last):
File "/XX/DSACancellationChecker-master/DSAChecker.py", line 185, in
performUpdate()
File "/XX/DSACancellationChecker-master/DSAChecker.py", line 144, in performUpdate
dateChangeURL = launcher.html.find(id="date-time-change").get('href')
AttributeError: 'NoneType' object has no attribute 'get'
Any idea?
Also, any plans to add automatic booking? ^_^
Hi, I'm getting the following error when the script is about to retrieve available dates. The previous script was working perfectly until the DVSA website change in Jan 2017. I've had to update to Python 3.6 (from 2.7) and BeautifulSoup4 on MacOS to account for the recent changes to the script. I thought I had everything installed correctly but wondered if the error was in the script or just the result of me missing something. Hoping someone can help...
---> Connecting to https://driverpracticaltest.direct.gov.uk/login
-----> Sending data:
-------> username = ExxxxxxxxxxxxxxL
-------> password = 3xxxxxx0
---> Connecting to https://driverpracticaltest.direct.gov.uk/manage?execution=e1s1&_eventId=editTestDateTime&csrftoken=HcoUKFYTk7U57lSTkBklvtMKj5ToZU1g
-----> Sending data:
-------> username = ExxxxxxxxxxxxxxL
-------> password = 3xxxxxx0
---> Connecting to https://driverpracticaltest.direct.gov.uk/manage?execution=e1s2&_eventId=proceed
Traceback (most recent call last):
File "DSAchecker.py", line 186, in
performUpdate()
File "DSAchecker.py", line 162, in performUpdate
datePickerPage.connect()
File "/Users/axxxxxxxxxxs/Downloads/DSA/DSACheckerClasses.py", line 28, in connect
self.response = self.opener.open(self.url, binary_data)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 532, in open
response = meth(req, response)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 642, in http_response
'http', request, response, code, msg, hdrs)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 570, in error
return self._call_chain(*args)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 504, in _call_chain
result = func(*args)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 650, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 500: Internal Server Error
I ran python3 DSAChecker.py
after filling in the info.py
but i get this error.
Traceback (most recent call last): File "DSAChecker.py", line 226, in <module> performUpdate() File "DSAChecker.py", line 165, in performUpdate dateChangeURL = launcher.html.find(id="date-time-change").get('href') AttributeError: 'NoneType' object has no attribute 'get'
Hi,
Got the following error. Can you let me know if I'm doing anything wrong?
[2015-01-10 @ 17:00]
---> Starting update...
---> Connecting to https://driverpracticaltest.direct.gov.uk/login
---> Connecting to https://driverpracticaltest.direct.gov.uk/login
-----> Sending data:
-------> username = <hidden>
-------> password = <hidden>
Traceback (most recent call last):
File "DSAChecker.py", line 187, in <module>
performUpdate()
File "DSAChecker.py", line 145, in performUpdate
dateChangeURL = launcher.html.find(id="date-time-change").get('href')
AttributeError: 'NoneType' object has no attribute 'get'
On first run after getting details I get the below:
Traceback (most recent call last):
File "./DSAChecker.py", line 226, in
performUpdate()
File "./DSAChecker.py", line 165, in performUpdate
dateChangeURL = launcher.html.find(id="date-time-change").get('href')
AttributeError: 'NoneType' object has no attribute 'get'
When I change it to print the text of the page I get:
[2018-07-05 @ 10:59]
---> Starting update...
---> Using agent Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Firefox/52.0
---> Connecting to https://driverpracticaltest.direct.gov.uk/login
Request unsuccessful. Incapsula incident ID: 802334360015240425-11923250173061570
So it looks like DSA have secured this behind some kind of Incapsula security.
If I get some time I will try and work around this.
I had a problem where the script would pick up an unexpected element from the page and crash out every time. I'm guessing the site has been updated. All it needs to fix it is a try/except surrounding the scanner.
Whenever the website is offline I get the following error.
Traceback (most recent call last):
File "DSAChecker.py", line 226, in
performUpdate()
File "DSAChecker.py", line 165, in performUpdate
dateChangeURL = launcher.html.find(id="date-time-change").get('href')
AttributeError: 'NoneType' object has no attribute 'get'
In the description, you specified that a cronjob is not required? How would the script repeat if the website is not online?
Every time getting this error:
[2018-05-31 @ 02:03]
---> Starting update...
---> Using agent Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Firefox/52.0
---> Connecting to https://driverpracticaltest.direct.gov.uk/login
---> Connecting to https://driverpracticaltest.direct.gov.uk/login
-----> Sending data:
-------> username = *****
-------> password = 404***
Traceback (most recent call last):
File "DSAChecker.py", line 226, in
performUpdate()
File "DSAChecker.py", line 165, in performUpdate
dateChangeURL = launcher.html.find(id="date-time-change").get('href')
AttributeError: 'NoneType' object has no attribute 'get'
The website requires the driving test reference number, not the theory reference number. The script still works fine if you just input your practical reference number into the 'theoryNumber' variable instead.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.