Regex.ai es un generador y solucionador de expresiones regulares con inteligencia artificial.
Para usar Regex.ai, simplemente inserta tu texto y resalta varias cadenas para encontrar expresiones regulares coincidentes. Puedes hacer clic en el texto resaltado para eliminarlo. Regex.ai generará y resolverá expresiones regulares en función del texto proporcionado.
Aquí está el Discord de Regex.ai: https://discord.com/invite/AZPWnBUGmP. Para obtener más mensajes de Discord, haga clic aquí(/es/discord/azpwnbugmp).
Aquí está el correo electrónico de soporte de Regex.ai para el servicio de atención al cliente: ibrahim62@hotmeil.com.
Regex.ai Nombre de la empresa: Liberty Labs .
Más información sobre Regex.ai, visite la página acerca de nosotros(https://regex.ai/aboutus) .
Enlace de Linkedin de Regex.ai: https://www.linkedin.com/company/libertylabsai/
Enlace de Twitter de Regex.ai: https://twitter.com/Regex_Ai
Por Taiba Hasan el Mayo 25 2024
Desbloquea tu potencial en programación: ¡8 técnicas de Regex que debes conocer!
Escucha en redes sociales
How to use Regex.ai!
Learn the basics of Regex.ai with this introductory video! Discover how this powerful tool can help you automate your data extraction tasks and streamline your workflow.
Python & Web Scraping Canvas PNG Image Processing for Text
Whilst exploring front end web scraping I came across a CANVAS HTML tag in a weather table, and when clicking on it I found I could select, as well as Xpath & CSS Selector its Image Data-URL and when I selected that & pasted it into the Browser it returned an image. This would be a method used by the website developers of stopping people scraping their website as it returned an image with text in the image. I took this as a bit of a challenge so downloaded the Image Data-URL via selenium and took the data and using the Base64 library encoded it and wrote it to a PNG file. After getting the file I used pytesseract & tesseract.exe to do an OCR (Optical Character Recognition) process on the image to extract the text from it, and wrote the result to a text file. The quality of the results were poor. About a 1/3 of the numbers were usable. I decided to play with Regex to see if I could find some regex to convert the results so that they were usable. I tried an AI regex creator https://regex.ai/ but was disappointed with the results, so used Bing Crosby (aka Bing Chat) to write some regex using athe python re library after giving it an example of the output I’d got from OCR. It sort of worked but as I only had about 1/3 of the data that was usable I was disappointed that you couldn’t use it as a reliable process. I tried using the python cv2 library to modify background of image to white and other transformations but the process generally degraded the resultant image and passing it back through tesseract gave me worse results. Then I downloaded the image from the browser, that showed a white background, and when I passed that through the OCR the results were very impressive. Almost 100 accuracy (only half info showing) . So when I looked at file and image size I found that the image from the browser had a smaller file size and was about 4500px x 100px whereas the initial image was la larger file size and the image about 6000 px x 113 px. So when I used an image resizer program for my initial image that I had and reduced its size to about 82%, so it roughly matched the 2nd image pixel density, and ran it through the OCR again the quality of the output was exact. So you can take a canvas image from a website to scrape it for the data. I was pleased with the exercise. The actual method I used to get the data from the table was to go to the backend and make a Get request for the JSON data being fed to the page, a far easier method to get the information. Link to files: https://drive.google.com/drive/folders/1RH47FFzASjQT4nD3Veshhn_2hT8ylm1t?usp=sharing A bit of familiarisation with OCR & regex though, and that was pleasing I hope this is of help to you, if so, can you please give a thumbs up for the video. Muchas Gracias Please visit my blog for similar topics: https://cr8ive.tk Kind regards, Max Drake
Python & Web Scraping Canvas PNG Image Processing for Text
Whilst exploring front end web scraping I came across a CANVAS HTML tag in a weather table, and when clicking on it I found I could select, as well as Xpath & CSS Selector its Image Data-URL and when I selected that & pasted it into the Browser it returned an image. This would be a method used by the website developers of stopping people scraping their website as it returned an image with text in the image. I took this as a bit of a challenge so downloaded the Image Data-URL via selenium and took the data and using the Base64 library encoded it and wrote it to a PNG file. After getting the file I used pytesseract & tesseract.exe to do an OCR (Optical Character Recognition) process on the image to extract the text from it, and wrote the result to a text file. The quality of the results were poor. About a 1/3 of the numbers were usable. I decided to play with Regex to see if I could find some regex to convert the results so that they were usable. I tried an AI regex creator https://regex.ai/ but was disappointed with the results, so used Bing Crosby (aka Bing Chat) to write some regex using athe python re library after giving it an example of the output I’d got from OCR. It sort of worked but as I only had about 1/3 of the data that was usable I was disappointed that you couldn’t use it as a reliable process. I tried using the python cv2 library to modify background of image to white and other transformations but the process generally degraded the resultant image and passing it back through tesseract gave me worse results. Then I downloaded the image from the browser, that showed a white background, and when I passed that through the OCR the results were very impressive. Almost 100 accuracy (only half info showing) . So when I looked at file and image size I found that the image from the browser had a smaller file size and was about 4500px x 100px whereas the initial image was la larger file size and the image about 6000 px x 113 px. So when I used an image resizer program for my initial image that I had and reduced its size to about 82%, so it roughly matched the 2nd image pixel density, and ran it through the OCR again the quality of the output was exact. So you can take a canvas image from a website to scrape it for the data. I was pleased with the exercise. The actual method I used to get the data from the table was to go to the backend and make a Get request for the JSON data being fed to the page, a far easier method to get the information. Link to files: https://drive.google.com/drive/folders/1RH47FFzASjQT4nD3Veshhn_2hT8ylm1t?usp=sharing A bit of familiarisation with OCR & regex though, and that was pleasing I hope this is of help to you, if so, can you please give a thumbs up for the video. Muchas Gracias Please visit my blog for similar topics: https://cr8ive.tk Kind regards, Max Drake