
orichec
Members-
Posts
13 -
Joined
-
Last visited
Everything posted by orichec
-
Conditional Use of _StringBetween Command
orichec replied to orichec's topic in AutoIt General Help and Support
-
Conditional Use of _StringBetween Command
orichec replied to orichec's topic in AutoIt General Help and Support
Yeah, I know that codes shared by mikell are working fine but my questions is that end results saved in the form of text contains several TAB Spaces and it's only plain text saved in text file I'm looking for text that should be on HTML format only having <br> tags so new line can easily b traced through HTML compiler when it used through HTML source. Please read my above post carefully, in this way, I think you can understand whole scenario and my point of view. -
Conditional Use of _StringBetween Command
orichec replied to orichec's topic in AutoIt General Help and Support
Thanks mate it's working super fine. But It show results as text in text box but when i tried to save it using Filewrite command it'll only show text with lot of TAB based spaces... 1 more thing i want to remove everything from my text like URLs, <b>,<div>,<img> tags except <br> because whenever i used this saved text through source codes it'll not showing where is line ends and it isn't. So please guide how can it possible to remove all html codes and URLs and only keep <br> tag where ever it is placed in my text source code file + plus removal of TAB based spaces from our saved text.... Saved Text file with extra spaces saved by our command is attached herewith for ready reference; html.txt -
Hello Guys, I build a autoit script to save source codes using give URL, then use _StringBetween Command to extract my desired content from saved source code's text file. I done everything upto my desires but I want to use _StringBetween command on conditional basis like text the extract from source codes having some kind for HTML parameters and URLs like <<img alt="image" src="https://en.wiki***.org/*****.jpg">><br><br><b> and similar other parameters like <div></div><p></p>, etc... I want to only copy text file source file after removing all the URL and other html based parameters but don't want to remove <b> these type of parameters because I want to save text with its original like breaks so <b> will help me to keep it in text to use to give breaks in my desired text... waiting for kind response...Thanks in advance... Sample text from _Stringbetween is looking like this; <img alt="image" src="//imghost.com/id_rk3FyZ.jpg"><br><br><b>Philosophy of Education and Its Importance</b><br><br>Behind every school and every teacher is a set of related beliefs--a philosophy of education--that influences what and how students are taught.<br><br>A philosophy of education represents answers to questions about the purpose of schooling, a teacher's role, and what should be taught and by what methods.<br> <br><span style="color: red;"><b>Note</b></span></b></span><br><br>As an academic field, philosophy of education is "the philosophical study of education and its problems...its central subject matter is education, and its methods are those of philosophy". "The philosophy of education may be either the philosophy of the process of education or the philosophy of the discipline of education.<br><br><a class="ajaxLink"href="https://en.wikipe***.org/wiki/Philosophy_of_edu****" rel="nofollow">Homepage</a></div> Codes to to generate specified data from source code's file is given hereunder; ;Starting fetching source codes from a given URL (URL placed in excel sheet at cell "C1") $IE = _IECreate(_Excel_RangeRead ($oWorkbook1, Default, "C1"), 0, 0 ) $source = _IEDocReadHTML($IE) FileWrite($file, $source) ; Extracting text from saved source code file and save it in a separate file "text01.txt" $target_source = _StringBetween($source, 'desc">', '<h2>') If Not @error Then FileWrite (@scriptdir & "\text01.txt", $target_source[0])
-
Automation - Torrent to Zip to http or ftp
orichec posted a topic in AutoIt General Help and Support
Hello, I'm little bit familiar with autoit coding/ scripting but this time I decided to automate torrent download system in the following way; Step No.1: Get Torrent (Magnet) download link from excelsheet Step No. 2: Use that magnet link to download torrent through any bittorrent client Step No. 3: wait until completely download of torrent and delete torrent from client Step No. 4: After completion of torrent compress the whole content into one file Step No. 5: Create HTTP/ FTP Link to download that torrent or upload compressed zip files on file-sharing website to get its http or ftp link. I researched a lot on here on this forum but unable to understand what should i do and where should i get started and what will be my first step. Please guide me, waiting for expert guidance. Thanks for you time... -
IECreate not working using Excelsheet values
orichec replied to orichec's topic in AutoIt General Help and Support
Thanks mate, it works for me.... -
Hello, I'm trying to save source of a particular webpage using its URL. When i tried to save source code using following command it works fine $IE = _IECreate( 'www.example.com', 0, 0 ) But my problem is different I've saved different URL in my excel sheet, that's why, I tried to use "$IE" command in this way; $URL = _Excel_RangeCopyPaste($oWorkbook1.Activesheet, "C1") $IE = _IECreate($URL, 0, 0 ) But It's unable to fetch source codes using URL placed in excel sheet 1 at cell No. "C1". Please guide me what's wrong with my codes and how can I make it possible to use URL placed in excel sheet instead of copying URL every time in "_IECreate" command. Thanks #RequireAdmin #include <Excel.au3> #include <IE.au3> #include <String.au3> #include <Array.au3> Local $oExcel = _Excel_Open() Local $oWorkbook1 = _Excel_BookOpen($oExcel, @ScriptDir & "\Software.csv", True) $file = fileopen(@scriptdir & "\source01.txt", 10) ;------------Below Command is not working--------------------- $URL = _Excel_RangeCopyPaste($oWorkbook1.Activesheet, "C1" ;------------String $IE unable to fetch data from URL available in excel sheet at cell No. "C1"--------------------- $IE = _IECreate($URL, 0, 0 ) $source = _IEDocReadHTML($IE) FileWrite($file, $source)
-
Hello everyone, I copied few information from website source codes but it has some kind of URLS but don't want those type of URLS in my final saved text file so what filter should I use to prevent copying URLS information in my final text file. I need just text not URLS in my final text file. Here is my coding #include <IE.au3> #include <String.au3> #include <Array.au3> ;getting the page source code and storing it into text file for easy reading it and debugging $file = fileopen(@scriptdir & "\source10.txt", 10) $IE = _IECreate("http://www.softpedia.com/get/Tweak/System-Tweak/Edge-Blocker.shtml", 0, 0) $source = _IEDocReadHTML($IE) FileWrite($file, $source) ;extracting source code between <div class="grid_28 mgtop_30"> and <div class="_tabpage tabpage hidden legible specifications" id="specifications"> $target_source = _StringBetween($source, '<div class="data">', '</div>') FileWrite ( "1.txt", $target_source[0]) _IEQuit($IE) fileclose($file)
-
Hello, I'm using Autoit for very long time but I just unable to create specific autoit it which help me to copy everything between two html tags (from "<div class="grid_28 mgtop_30">" to "<div id="specifications")...I'm trying to copy description of free version or trial version of software using softpedia website. My starting Point=<div class="grid_28 mgtop_30"> My ending Point=<div id="specifications" My script should find starting point first from opened source codes of website and start selecting data between my starting and ending points. After selecting this data script should copy that text only. I tried to create following code but not works for me; <snip> Please help me to make this possible I also attached a picture (and highlighted desired text to copy) for source codes of website where i want to copy content; <snip>
-
Hello, I'm using Autoit for very long time but I just unable to create specific autoit it which help me to copy everything between html tags (from " <div class="data"> to "<h2>Related Torrents</h2>")... My starting Point=<div class="data"> My ending Point= <h2>Related Torrents</h2> My script should find starting point first from opened source codes of website and start select data between my starting point and ending point. After selecting this data script should open text file and paste this copied data in text file and save and close it. I tried to create following code but not works for me; <snip> Please help me to make this possible I also attached a picture (and highlighted desired text to copy) for source codes of website where i want to copy content;