Regex.ai是一个由人工智能驱动的正则表达式生成器和求解器。
要使用Regex.ai,只需插入您的文本并突出显示多个字符串以找到匹配的正则表达式。您可以点击突出显示的文本以删除它。Regex.ai将根据提供的文本生成和解决正则表达式。
这个是 数组 Discord的链接: https://discord.com/invite/AZPWnBUGmP. 更多 Discord 信息, 请点击 discord链接(/zh/discord/azpwnbugmp).
以下是 数组 支持邮箱含客户服务: ibrahim62@hotmeil.com .
数组 公司名字: Liberty Labs .
更多关于数组, 请访问 the about us page(https://regex.ai/aboutus).
数组 Linkedin链接: https://www.linkedin.com/company/libertylabsai/
数组 Twitter链接: https://twitter.com/Regex_Ai
社交媒体聆听
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