How to get real CAPTCHA images with python selenium - selenium-webdriver

I'm trying to solve a sliding CAPTCHA on https://beian.miit.gov.cn. I want to save the image as a local file and run some edge detection algorithm on it to obtain the correct offset, but the image is not given by a url (maybe it's a javascript? src="data:text/javascript;base64,/9j/4AAQSkZJRgABAQEAYABgAAD/2wBDAA...). How can I download the image?
I should probably change the problem title, but I'm not sure how to describte my problem in a more technical way.
Here is the code that gives the background image:
<img data-v-8408b814="" id="bgImg" width="500px" src="data:text/javascript;base64,/9j/4AAQSkZJRgABAQEAYABgAAD/2wBDAA0JCgsKCA0LCgsODg0PEyAVExISEyccHhcgLikxMC4pLSwzOko+MzZGNywtQFdBRkxOUlNSMj5aYVpQYEpRUk//2wBDAQ4ODhMREyYVFSZPNS01T09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0//wAARCAC+AfQDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPw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/AGia3m1YWaxQzWqyN5f3t+f5ipCY/wC16Fc/vZF8tj/D5Z4/Liis+e9t7h/OisUQOMkbsc/hRVGZ/9k=" alt="" style="height: 190px; display: block; position: absolute; top: 0px; left: 0px;">

What you are doing does not seem morally correct.
The source of the image is base64, with python you can decode it and save it as a file:
EDIT: Here is the code working:
import base64
encoded_string = yourElement.get_attribute('src').replace('data:text/javascript;base64,', '')
decoded_string = base64.b64decode(encoded_string)
with open('captcha.jpg', 'wb') as f:
f.write(decoded_string)
output:

Related

Github pages not rendering CSS correctly as it is locally

CSS Is not rendering as expected for the ReactApp as it is locally.
On Github
On Locally
Not attaching any code, however if you need any specific file, let me know will edit question accordingly.
EDIT
I seems the position: fixed was causing the issue:
Earlier:
.navbar-custom {
z-index:100;
position: fixed;
}
Later:
.navbar-custom {
z-index:100;
/* position: fixed; */
}
Also, please ensure to disable caching::

Correct picture path

I have this site
(Gatsby and Strapi API deployed in Heroku). My problem is that I can't find the proper path to render the pictures.
Here is the API and here is the repo.
My code regarding the rendering of the pics:
.map(band => (
<article className="bands" key={band.id}>
<h2>{band.band_name}</h2>
<img
src={band.band_img.name}
alt={band.band_name}
/>
<p>{band.band_desc}</p>
I've already replace src={band.band_img.name} to a number of things like:
band.band_img.formats.thumbnail.url
band.band_img.url
so on and so forth to no avail.
A friend of mine told me to create .env files
uploads_path: /uploads/ (.env.production)
and
uploads_path: uploads/ (.env)
I did and nothing.
Picture of console.log(band.band_img)
Please, any suggestions? Thank you in advance.
Your problem is that the images are not being uploaded. If you look at the following images path, they won't be displayed (what you were trying so far):
https://lebraojohns.netlify.app/static/uploads/thumbnail_badreligion_7007c2c028.jpeg
https://lebraojohns.netlify.app/uploads/thumbnail_badreligion_7007c2c028.jpeg
I've tried looking at several paths but none of them worked for me.
You won't see any image so your code is not able to display anything at band.band_img.name with according to your API is where it should be:
band_img: {
id: 7,
name: "badreligion.jpeg",
alternativeText: "",
caption: "",
width: 315,
height: 160,
formats: {
thumbnail: {
ext: ".jpeg",
url: "/uploads/thumbnail_badreligion_7007c2c028.jpeg",
hash: "thumbnail_badreligion_7007c2c028",
mime: "image/jpeg",
name: "thumbnail_badreligion.jpeg",
path: null,
size: 9.63,
width: 245,
height: 124
}
}
P.S: I love Bad Religion and all the bands 🤘
Your code looks good as soon as you fix your image uploading/server issue the code should work alone.
The images that you have stored under /src/assets will be never accessible for your code (transpiled to the public folder) unless you use them in one component.
Depending on your specifications, you can bypass it by adding your images under the /static folder to clone them into the public one.
It's a problem with your server, for example the following should work:
const getBandImg = (band) => band.band_img?.formats?.url;
And to use it anywhere you want to get the img url:
.map(band => (
<article className="bands" key={band.id}>
<h2>{band.band_name}</h2>
<img
src={getBandImg(band)}
alt={band.band_name}
/>
<p>{band.band_desc}</p>
Which you already tried with band.band_img.formats.thumbnail.url, but after taking a look at your website, I noticed that the images aren't reachable either in the API or the frontend, for example:
https://john-strapi.herokuapp.com/uploads/dri_6a22b5e947.jpeg
Doenst return the image
https://lebraojohns.netlify.app/uploads/dri_6a22b5e947.jpeg
Neither
So it is something you have to solve in your host, not a problem with gatsby

React Avatar Editor

I have a react component which uses DropZone.
Actions are like this:
Add image to DropZone Area.
Image added is uploaded using PHP and a URL is sent back to next step.
This step show the React Avatar Editor holding the URL to the uploaded image.
I have set up the Avatar area/component like this:
setEditorRef = (editor) => this.editor = editor
<AvatarEditor
ref={this.setEditorRef}
image={this.state.image} // URL to uploaded image
scale={this.state.scale}
position={this.state.position}
onPositionChange={this.handlePositionChange}
style={{width: '310px', height: '263px'}}
border={10}
color={[255, 255, 255, 0.8]} // RGBA
rotate={this.state.rotate}
/>
What I need (AFTER dragging the image around, scaling it or rotating) is to send the image within the canvas to a php script, and save it. I know how to do this, but I cannot figure out how to access the image "constrained" by the canvas?
I've tried Avatar Editor's solutions (mentioned on the github).
this.editor.getImageScaledToCanvas().toDataURL('image/jpeg', 1);
and
this.editor.getImage();
But using axios and
let formData = new FormData();
formData.append('file', linkToCanvas);
does not work. (LinkToCanvas) should be the image held by the Avatar Canvas.
I also have the following issue after Image upload (solving this one enables me to solve the first issue as well, as I know the orientation of the image shown):
When uploading (4mb+) image files, I strip the EXIF information, save the image and returns a URL to Avatar Editor pointing to the new image.
If the image is vertical - Avatar shows the image horizontally (even when removing the EXIF info from the jpegs). Any way to force React to load an image 1-to-1, as it is stored on my server?
Any help is HIGHLY appreciated, as I've been struggling with this for a week now :-(
I know it's a long question. But I'm hoping for a short answer.
Thanks
The problem is that editor is not added to references.
To fix this, declare editor before constructor
...
import AvatarEditor from 'react-avatar-editor';
class YourClassName extends React.Component<any, any> {
editor: AvatarEditor;
constructor(props: Props) {
...
change setEditorFunction to this
setEditorRef = (editor: any) => {
if (editor) {
this.editor = editor;
const img = this.editor.getImageScaledToCanvas().toDataURL();
console.log(img);
}
}
And the last step change reference in component
<AvatarEditor
image={this.state.image}
width={this.state.width}
height={this.state.height}
color={[0, 0, 0, 0.6]}
scale={this.state.scale}
rotate={this.state.rotate}
position={this.state.position}
borderRadius={this.state.borderRadius}
ref={(ref) => this.setEditorRef(ref)}
onLoadSuccess={this.loadSuccess}
/>
A workaround but maybe not the best solution to Avatar Editor forcing rotate on jpgs. I use php to detect EXIF data. Rotate if this is needed. Then create a png from the jpg. Then save it and unlink “old jpg”. And finally return its location to my react script.
This solves the rotation problem. So now I can crop/rotate the image on the canvas and using the
getCroppingRect()
I can retrieve x, y, width and height and handle crop serverside. Finally enabling me to store the crop area.
However a new problem is now issued, as the editor rotates the image around its canvas center, so even if I can retrieve coordinates for the cropscript, as well as the rotation angle, its still misplaced, as php’s rotateimage rotates on the image center.
Anyone know how to rotate an image on a canvas around the image center?

Create something of similar to Watson Virtual Agents

I've seen the gif on this page:
https://github.com/watson-virtual-agents/chat-widget
And I want to creato with IBM Watson Conversation tool something similat to this
In which user can choose between some options inserted in a cicular bottom. Do you know how is it possible?
Pretty sure you can do this example.
The summary you need to know: Watson Conversation is one endpoint REST API, so, you can call this service in your backend and to anything in your front end, for shows the messages for your user in different forms (front-end).
In this case, your example is one Web page, so, probably inside the Watson conversation, you need to add the html for the buttons in the response.
You can see this example from one IBM Developer - Ashley using buttons in Watson.
Conversation simple is one awesome example that you can use to understand how Watson Conversation works and one based for your projects using this API. This project is built in Node.js.
See the Official API Reference for use IBM Watson Conversation.
Ok.
I've inserted this code
<script>
function yesBye() {
var latestResponse = Api.getResponsePayload();
var context = latestResponse.context;
Api.sendRequest("yes", context);
}
function noBye() {
var latestResponse = Api.getResponsePayload();
var context = latestResponse.context;
Api.sendRequest("no", context);
}
</script>
inside /ui/index.html (he suggests me to sobstitute " with ' and I make it)
this code
#button-yes {
width: 100px;
margin: 5px;
font-size: 16px;
border: none;
border-radius: 2px;
background-color:#66B266;
color: white;
}
#button-no {
width: 100px;
margin: 5px;
font-size: 16px;
border: none;
border-radius: 2px;
background-color:#ff3232;
color: white;
}
inside /ui/css/conversation.css and inside /ui/css/main.css
and this code
"text": "Would you link to end our conversation?\n\n<button id=\"button-yes\" onclick=\"yesBye();\">Yes</button> <button id=\"button-no\" onclick=\"noBye();\">No</button>"
inside the code js editor of the single node
This is the situation
image
it means that page recognise button but don't recognise their css style.
The structure of my project is the same of this (https://github.com/watson-developer-cloud/car-dashboard) and after every edit I deploy again the project. Where is the mistake?
Ok, but it's not a CSS problem. By losing the buttons, any type of modification I make to the index.html file does not appear.
Not even if I try to replace the "Type something" string in the bottom box.
I tried to empty the cache, resume the deploy at every modification, check that the service names and contents of the manifest.yml file were correct, but nothing. Work space and environment variables are correct.
Every time I hit the play button in the eclipse ID I see this
https://imgur.com/a/oe5lt
with the "Failed to read application content" error message.
Is there anything inside the code (which you can find here https://github.com/watson-developer-cloud/car-dashboard) that blocks any type of modification?

swfobject flashes white before swf has loaded

I have the following code, I have set the bgcolor and still my page flashes white prior to swf loading. Basically i want the background to always be black, my page body tag has a black background.
<script type="text/javascript">
var path = "/media/19519/la_03.swf";
var videowidth = "955";
var videoid = "swf1454";
var videoheight = "540";
var flashvars = {};
var attributes = {};
var params = {
wmode: "opaque",
bgcolor: "#000000",
allowfullscreen: "true",
allscriptaccess: "always"
};
swfobject.embedSWF(path, videoid, videowidth, videoheight, "9.0.0", flashvars, params, attributes);
</script>
it's probably from your swf loading. I had a similar problem with a large swf and the way I got it to stop was to pause the swf in the first frame until it was done loading. Then just put an empty frame at 1 and make it the bg color. Once the swf is ready to go the animation starts
Make sure the html element containing the swf is black too.
I know this is an old post, but for people who stumble upon this post via search engines:
A flash of white is sometimes a byproduct of SWFObject's 'autohide' feature (CSS is used to hide the fallback content before the SWF loads). If you don't want to see the flash of white, try disabling SWFObject's autohide feature:
SWFObject documentation:
What's new in 2.2: The option to switch off SWFObject's default show/hide behavior
SWFObject 2.2 API docs: swfobject.switchOffAutoHideShow()
Of course, how you build your SWF will also impact whether you see a flash of white.
For me, the issue was in background color of the swf file.
When not explicitly set, it defaults to white until loaded. So just set it explicitly and you won't have a white flash.
var params = {bgcolor:"#000000"};
swfobject.embedSWF("my.swf", "flash", "100%", "100%", "10.0.0", false, {}, params);

Resources