Requesting help in extracting user comments from a forum ( HTML WEBSITE)

hello experts,
As i m new to java and i got this college project in hand which has to completed in few days i require some expert advise.
Basically what my job is to extract all the user comments from a forum and make a text file.. for example this is one of the website http://www.gsmarena.com where user have posted many reviews and comments about mobile phones . ex : http://www.gsmarena.com/nokia_n97-reviews-2615p2.php .
now looking at source code , all user comment are inside <P class="uopin"> tag under <DIV class="user-thread"> element.
So i want to ask if there is any method in java that can extract all contents from class "uopin" directly ?
i have no problem opening URL connection and reading the webpage but i m not able to extract that specific content . please enlighten me in this regard.
Actually i m searching this forum since last 3 hours trying to find an answer and i found that i have to learn Regex , indexOf() subString() , HTMLEditorKit() etc.
I ma planning to learn them in detail but as i have very less time ( 2 days to be specific) , i want help from you experts to solve this problem. plz guide me with some code snippets .
Thankyou for your advises in advance :)

ok.. sorry for asking that way.
Here is my work till now....
i wrote this code :
import java.io.*;
import java.io.Console;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.URL;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class MyRobot3
     public static void main(String[] args) throws IOException
          BufferedReader in = new BufferedReader(new FileReader("MyRobot3.txt"));
          String inputLine , nextLine,kutta;
        FileOutputStream out; // declare a file output object
        PrintStream p; // declare a print stream object
          out = new FileOutputStream("myfile3.txt");
          p = new PrintStream( out );
             while ((inputLine = in.readLine()) != null)
                         Pattern p1 = Pattern.compile("(<p\\sclass=\"uopin\">)(.*$)" );          
                    //     Pattern p1 = Pattern.compile("(<p\\sclass=\"uopin\">)(.*$\r\n.*$)" , Pattern.MULTILINE | Pattern.UNIX_LINES);    //not working
                    //Pattern p1 = Pattern.compile("(<p\\sclass=\"uopin\">)(.*\\s)" , Pattern.MULTILINE );
                         Matcher m1 = p1.matcher(inputLine);
                         boolean found = false;
                         while (m1.find())
                         p.println(m1.group(2));
}I am testing with a little file MyRobot3.txt which contains
<p class="uopin">Although they didn't announce any winner here. But to me the winner is <br/>
N900. Then opera is in second position. (overall averare result)</p>And i am getting output in a file : myfile3.txt
Although they didn't announce any winner here. But to me the winner is <br/>which is just the first line , but i need to match that line break also. i m not able to figure it out .please help me fixing this code so that it can match all the text and remove the <br> tag ..

Similar Messages

  • Get user comments from Service Manager 2012

    Hi all,
    For some Service Manager customizations, I want to "export" the user comments from incident tickets to an email message. I want to do this with Orchestrator.
    I was thinking to create a runbook with the follow components:
    - Get Incident
    - Get relationship (Related class = Trouble Ticket User comments)
    In the last activity "send mail", I want to add the user comments. But I can't find the user comments from the Published data. (see print screen) 
    Know anyone of you if it is possible to get the user comments? If Yes, How to do that?

    Hi!
    Yes, it is possible. "Get Relationship" does just exactly that, it only gets the relationship between the Incident object and the Trouble Ticket User Comment object. After you have retrieved this, you then need to get the actual related object.
    To do that, you Get Object, the class you want (in this case Trouble Ticket User Comment), then make sure you add a filter to search for the "Related Object Guid" from the published data of the Get Relationship.
    Make sure you select the "Related Object Guid"! It is a very common mistake to choose "SC Object Guid", but that is just the guid of the relationship...not the object you want ;)
    A bit tricky to understand at first, but easy enough after you get the hang of it.

  • Extract user list from NT 4.0 Domain

    Hi All,
    I am in the process of upgrading the NT4 domain to Active Directory.
    Can someone please provide a a way to generate a topology diagram for Windows NT infrastructure. 
    I know this is a very old technology, however i am now handicapped since none of the tools, like (hyena, AD Manager, DS Query, etc) are working. 
    Is there any method to run a topology diagramming similar to Active Directory Topology Diagramming in NT4.0 domain.
    Also i want a way to extract the active user list from NT Domain as well.
    OS version is windows NT 4.0 SP6
    Regards, Triyambak

    Hi Paul, Thank you for reverting it back. I think i do have one of the member server 2003 joined into the NT4 domain. I will surely give it a try. Does it need to be a DC, if yes, how can a DC be promoted in an NT4 environment.
    In my current scenario there are around 2000 servers joined into the NT domain  and I need to upgrade the NT to active directory. There are few things as per the design so far.
    >The members are all static IP addressing
    > there is no DNS in NT so they use a dns suffixes to a different domain (2008 functional level)
    > NT 4 is used only as authentication source.
    > Not sure if there are any NT Domain service accounts configured in the member servers.
    Complex isnt it..

  • Request: Problem in Extraction of data from CRM to BW

    Hi Gurus
    I have problems in extracting the data from CRM to BW.I thought you are the one who can solve them:
    1) When I check the data in the datasource in RSA3 i can see all records as well as i can see complete data in that but when i extract and check the data in cube i can see all records but i cannot see the complete data i.e some data is missing.
    2)And another problem is that In report i have 2 characteristics(DATS) start date and end date now i am trying to get number of days from start date to end date.
    I appreciate you in advance. If u find any good documentation please send me to [email protected]
    With regards
    Nagamani.

    Hi krishna,
                       yes we did enhancement to this data source. In PRDOCTION its taking 27 hours time  to load data.
              For extraction from source system (CRM) its taking  nearly 24 hours time  as per JOb LOG .
    08/05/2010 11:53:08 Call customer enhancement EXIT_SAPLRSAP_001 (CMOD) with 10,849 records
    08/05/2010 12:02:02 Result of customer enhancement: 10,849 records
    08/05/2010 12:02:03 PSA=0 USING & STARTING SAPI SCHEDULER
    08/05/2010 12:02:03 Asynchronous send of data package 1 in task 0002 (1 parallel tasks)
    08/05/2010 12:02:06 IDOC: Info IDoc 2, IDoc No. 1576298, Duration 00:00:01
    08/05/2010 12:02:06 IDoc: Start = 08/05/2010 10:26:37, End = 08/05/2010 10:26:38
    08/05/2010 13:02:38 Call customer enhancement EXIT_SAPLRSAP_001 (CMOD) with 10,958 records
    08/05/2010 13:11:48 Result of customer enhancement: 10,958 records
    08/05/2010 13:11:52 Asynchronous send of data package 2 in task 0003 (1 parallel tasks)
    08/05/2010 13:11:53 tRFC: Data Package = 1, TID = 0AA00D0301984C5AEE8E44DB, Duration = 00:16:
    08/05/2010 13:11:53 tRFC: Start = 08/05/2010 12:02:19, End = 08/05/2010 12:18:27
    08/05/2010 14:30:13 Call customer enhancement EXIT_SAPLRSAP_001 (CMOD) with 11,296 records
    08/05/2010 14:39:53 Result of customer enhancement: 11,296 records
    like this its taking 24 hours in extraction its self.
    Edited by: kotha123 on Aug 10, 2010 12:08 PM
    Edited by: kotha123 on Aug 10, 2010 12:09 PM

  • Help with migrating user data from one account to another

    I am on a G5 with 10.4.11. I installed FCP studio 6 and everything works fine except compressor. I have had only one user account on this mac (i will call it account 1). I was told to create another account (account 2), log on and see if compressor works. It does. Basically there are files missing on account 1 and compressor won't run. I have installed 3 times and no change.
    Anyway I was told to migrate all my user data from account 1 to account 2. I have been looking at threads and want to make sure I am doing the right thing. I found a way to close. Please see if this works. IT may be from the tiger forum:
    pick a short user name for your new account. then run the following terminal commands
    sudo mkdir /users/newshortname
    sudo ditto ~ /users/newshortname
    You'll have to enter your admin password (which you won't see) after the first command. that's normal. This will copy your current home directory to /users/newshortname. Then go to system preferences->accounts and create a new account with the short name newshortname. You'll get a popup saying that a home directory by that name already exists and asking if you want to use it. say yes.
    Anyway, I would like to migrate everything from account 1 to 2 and have all preferences...everything. I would also like to be able to delete the old account...account 1 and rename account 2. Since this is a home MAC, I really don't need it PW protected. I would like this MAC to just use my new account 2 at start up.
    Please ask me any questions. This is my editing MAC, and I can't get around inside the OS. I know FCP like the back of my hand, but don't want to screw up this computer.
    Thanks in advance.
    Message was edited by: Nelson May

    Yeah, you should be able to move most of it by changing permissions.
    Network settings could be any/all of these though for instance...
    /Users/YourUserName/Library/Preferences/ByHost/com.apple.networkConnect.<12 digit number>.plist
    /Users/YourUserName/Library/Preferences/com.apple.internetconnect.plist
    /Library/Preferences/SystemConfiguration/preferences.plist
    /Users/YourUserName/Library/Preferences/com.apple.systempreferences.plist
    /Library/Preferences/SystemConfiguration/com.apple.airport.preferences.plist
    /Library/Preferences/com.apple.sharing.firewall.plist
    /Library/Preferences/SystemConfiguration/NetworkInterfaces.plist
    /Library/Preferences/com.apple.networkConfig.plist
    /Library/Preferences/SystemConfiguration/com.apple.nat.plist
    /Library/Preferences/com.apple.print.FaxPrefs.plist
    As well as the old Keychain & cookies from your Browser.

  • User Banned from the forum using proxy server??

    HI for awhile now I cannot get on the forum without disabling my proxt server. Why is  this? Does adobe need my IP so badly??? This has been going since they started the cloud.. Please help me find out how to get on while on a proxy server. I use netshade and a VPN. It just can't find the server.
    Here are the screen shots
    and

    Thanks for the advise Pat. this is recent problem. So I guess adobe does not have a work around in the offing? Does this mean that my proxy server is funeling some of those IPs?? Is it flagged somehow?? I suppose I can't reinstall while the proxy is in place then so it will see and recognize it? well thanks anyway. do you have any idea if this is why adobe thinks I am in trial mode when I really have a full license?? I keep getting the pop-up and the days keep counting down and I keep putting in my full license and it keeps asking every time I open the app. I don't wnat to get to day 0 and not be able to use photoshop which I paid full price for when it first came out! Any help would be most welcome. thanks aloha, Uhane
    Pat Willener wrote:
    I don't think Adobe is interested in your IP address.  Also, banning proxy servers is not directed against you, but against certain people who really want to hide their IP addresses: spammers.
    You don't know how many spam messages are removed daily from this forum by moderators and administrators.  Forum spam has become a great problem over the last few years, and banning IP ranges from where forum spam originates has been quite effective.
    So I don't think there is a way of letting legitimate users like you using a proxy server to login, while at the same time keeping spammers at bay.

  • Request help for Extracting CLOB String

    Hi Everyone,
    I am getting the input string in the form of CLOB delimited by '~'. I have to tokenize the string and insert those values into the below table through procedure / function.
    Create table TEST_TEMP ( NUM NUMBER(10),
    NAME VARCHAR2(1000),
    DESCRIPTION CLOB,
    VALIDATION CLOB,
    CREATED_DATE DATE,
    COMPLETED VARCHAR2(1),
    USER NUMBER(3));
    For example the input string would be '11~test~sdfsdfsd~ewrerwerwerw~2007-10-10 13:00:00~Y~123'
    Can you suggest any ideas / links how to do this?
    Thanks

    You can use this select to extract the values:
    michaels>  with test1 as (
      select '11~test~sdfsdfsd~ewrerwerwerw~2007-10-10 13:00:00~Y~123'  str from dual union all
      select '12~test2~sdfsdfsd~ewrerwerwerw~2007-10-11 13:00:00~Y~123'     from dual)
    select t.column_value.extract('s/s[1]/text()').getnumberval()  num,
           t.column_value.extract('s/s[2]/text()').getstringval()  name,
           t.column_value.extract('s/s[3]/text()').getclobval()  description,
           t.column_value.extract('s/s[4]/text()').getclobval()  validation,
           to_date(t.column_value.extract('s/s[5]/text()').getstringval(),'yyyy-mm-dd hh24:mi:ss')  created_date,
           t.column_value.extract('s/s[6]/text()').getstringval()  completed,
           t.column_value.extract('s/s[7]/text()').getnumberval()  "USER"
      from test1, table(xmlsequence(xmltype('<s><s>' || replace(str,'~','</s><s>') || '</s></s>').extract('s'))) t
           NUM NAME  DESCRIPTION      VALIDATION               CREATED_D COMPLETED        USER
            11 test  sdfsdfsd         ewrerwerwerw             10-OKT-07 Y                 123
            12 test2 sdfsdfsd         ewrerwerwerw             11-OKT-07 Y                 123

  • Program to extract user list from SM12

    Hi experts,
    Need one help to get a list of users who are currently having a lock entry in SM12 based on a lock argument. Is this possible to input the lock argument and get a list of such users through some function module or table lookup in batch mode ? I need to send a message via SM02 programmatically to all such users.
    Thanks,
    Neeraj

    Hi,
    YOu just use the function module ENQUEUE_REPORT , it will return a table with all lock entries and the correpsonding users.
    Thanks,
    Ramakrishna

  • Extract User List from Security Manager

    Hi,
    How to extract or export the list of users created in MII under Security Manager to some document like Excel.
    Regards,
    Adarsh

    Thanks Jeremy....
    It works great!!
    Just a thought......Is there a way to combine both Users and Roles and get the document like
    User Name and his corresponding role.
    Regards,
    Adarsh
    Edited by: Adarsh Sidnoor on Jun 8, 2009 3:36 PM

  • Requesting help to convert an .llb from LV5.1 to 7.1 or higher

    Could someone please open up the support.llb (attached) and convert "Convert CVI Error Codes.vi" from LabVIEW 5.1 to version 7.1 or later.  I have 8.6 installed and am unable to convert the VI.
    Thanks in advance for your help
    Attachments:
    Support.llb ‏48 KB

    Hi testguy99,
    here it is.
    Mike 
    Attachments:
    Support.llb ‏36 KB

  • Can I get some help with CF8 and Unix from this forum?

    I did my dev in my local machine running windowsXP and CF8
    In prod. environment, my CF8 runs in Unix and I'm not familiar with Unix at all.
    My manager is out for awhile and I want to do this if I could without waiting for him because in windows it is very simple.
    Here is what I did in windows and I think I should do the same in unix but unfortunately I don't know how:
    In Windows environment I have done the following successfully and easy:
    1. installed/moved a .exe file in 2 folders: 1. in cfx folder under Coldfusion8 folder and
                                                                2. and again in CFClasses folder under WEB-INF folder
    2. Then in CF8 administrator I went to SERVER SETTINGS >> Java and JVM >> under ColdFusion Class Path, I put: c:\Coldfusion8\cfx\cfx_myexe.jar >> submit
    3. Under CFX Tags >> clicked REGISTER Java CFX >> I put: cfx_myexe in Tag Name and the same in Class Name  >>submit
    Then when I go to my application, everything work as a charm!
    How can I do these things in Unix?
    When I logged into CF server in unix using my FTP FileZilla, I immediately see /space/users/www , so I'm in the root directory. I can't see anything above this directory
    In windows, CFX is found under ColdFusion8 folder AND cfclasses is found under WEB-INF folder like this:
    C:/ColdFusion8/www/WEB-INF/cfclasses
    All my CF files for the application are on C:/Inetpub/www/myfolder/
    So my questions are:
    1. How can I access point 1 using my FTP to move my exe file to the right folders
    2. Since I don't have CF administrator interface with Unix, how can I do point 2 and 3 above????
    I have searched on this forum if someone had this problem in the past and also googled it but I got no result.

    1)  If the account you use to FTP to the site does not give you permissions to the ColdFusion instlation directories, you will need to ask permission from whomever in your organization provides those permissions.
    2) You would run the same ColdFusion administrator tool.  It is usually located at yourwebsite-domain/cfide/administrator/
    If it is not located at this location, you need to ask whomever controls your ColdFusion server where it is located and how you should access it.
    In otherwords, these are not general problems that we can help you with much.  These are specific problems dealing with your organizaiton and how it has configured its systems and network.

  • BI- Extract Hour:Min from date and get Avg

    Hi there,
    am working on BI answer and trying to get the average of the working hours of the departments. The Working Hrs column is Date format in the Database. And I managed with Forum help to Extract the Hours from this column and do the average through the BMM in the RPD on the Fact table as following:
    EXTRACT( HOUR FROM "Ain_Access"."Fact_Access"."Working Hours")
    Now on the BI Answer results I have 8 instead of 08:57.
    But what I need is to Extract the Hour and the minuets and get their AVG.
    Appreciate your help,

    Averaging column with date/time format in BI Answer
    this expression will work:
    (60 * EXTRACT( HOUR FROM "Ain_Access"."Fact_Access"."AVG Working Hours" ) + EXTRACT( MINUTE FROM "Ain_Access"."Fact_Access"."AVG Working Hours" )) / 60
    but only if this "AVG Working Hours" is DATE type.... and this look like strange name fore DATE? "AVG" is average, aren't?
    Arent u need to use "Working Hours" instead of "AVG Working Hours" ?
    like this:
    (60 * EXTRACT( HOUR FROM "Ain_Access"."Fact_Access"."Working Hours" ) + EXTRACT( MINUTE FROM "Ain_Access"."Fact_Access"."Working Hours" )) / 60
    all best
    phenix

  • HT1329 Help me move my music from my iPod onto my new laptop...please!?!

    Hi!  The steps to do this are clearly explained in the HELP section...but when I try to follow the steps and open the iPod, I only get three folders: Calendars, Contacts, and Notes, all of which are empty!  However, when I have iTunes on and am looking at my iPod as a DEVICE...I can see all the music in it. 
    How can I move what iTunes can SEE into my laptop library?!  Does this have anything to do with me having a Sony VAIO, which is very media-full...but I don't really know how to use yet?
    Help?
    Cheers,
    Kristin

    See this excellent user tip from another forum member turingtest2 outlining the different methods and software available to help you copy content from your iPod back to your PC and into iTunes.
    Recovering your iTunes library from your iPod or iOS device
    B-rock

  • Extracting jpeg's from LR when missing originals.

    Hi,
    I've crashed 2 harddrives and they can not be recovered.  It's been a 2 week long horror fest.
    Most of my photos were imported into Lightroom and I can still see the previews. But the originals are, of course gone. I've researched and see that LRViewer has helped people extract jpeg's from Lightroom (lower res) but this application is not working for me.  I even tried applying it to previews where the originals ARE on my harddrive and it still won't work. Message reads: Can't find previews SQlite database.
    anyone have another way of doing this??? Please!!!
    I'm using Lightroom 3.0!!!
    There must be a way...

    Are you sure you're opening the catalog with the "[catalogname] Previews.lrdata" right next to it? LRViewer won't work if you open a backup catalog, which does not have the preview folder next to it.
    It works fine for me with an LR3 catalog.
    Beat

  • How do I isolate or extract an image from a photo?

    Does anyone know of any programs that will help to extract an image from a photo so it doesn't have an ugly background?

    I use PhotoShop Elements 6 - click here for links to other graphic programs to consider (not all will do what you want).
    LN

Maybe you are looking for

  • In the calendar side bar, the groups titled "On my Mac" and "iCloud" will not merge?

    I recently updated my Macbook to Mavericks and my phone is already updated to IOS7. In iCal, there is a side bar, and there are 3 groups... "On my Mac" "iCloud" "US Holidays" Since all my main events are in the group "On my Mac" they do not sync with

  • No sms after updating to iOS 6.1.2

    Hi everyone, I can't send text messages from my good old 3GS after installing iOS 6.1.2. Of course I tried the simcard in another cellphone, works like a charm. I also tried another simcard in my 3GS (from another carrier, since it's an unlocked iPho

  • How to create an OAF page that does not need login to access

    We have a lot of Oracle users, and everyday there are some users forget there username or password and need reset. I really want to use a web page to let them reset their passwords automatically. The web page will call the API to reset password if it

  • Creating a form with radio buttons that users can fill, save, and e-mail back

    Hi all, I am new here, so please forgive me if this answer has already been answered. I have been looking around and still have not been able to find an answer. I have created a pdf in InDesign and opened it in Acrobat to create a form out of that ex

  • Nokia Imagestore: how to store images to a UNC-pat...

    Hi, I am just wondering why it is obviously impossible to tell Nokia Image Store (which comes with PC Suite) to a UNC-Path, like \\MyServer\Images Instead, this progrtam behaves like a 20 year old legacy application, and only allows drive letters to