#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2014
    Posts
    8
    Rep Power
    0

    How to expand all tree structure at once in webpage


    Hi! I am a Chinese from Malaysia, I have been use google and yahoo to search for css and html answer few weeks already , but because of i am study mechanical engineering , have no coding basic at all , so until now i still cannot solve my problem.
    Everyday I have to copy and paste all data from a webpage's tables into Excel; there are more than 100 tables, each table contains 10 rows, each row is a link. When I click on it, it will expand and shown its content, but when I click on the 2nd row , the 1st row content will hide automatically, and when I click on the 3rd row, the 2nd row and other content also will hide automatically...
    So I need to click the row 1 by 1 in order to show its contents and copy paste into excel, which is tedious and time consuming.
    I have ask my boss for permission to log in and share his table data , this is my extra job i need work for him.
    this jsfiddle.net/engchiang/ghP2a/5/ , where its output result is when i open the website , the contents of 10 rows are all hidden.
    The upper left corner is source code , the lower right corner is output result. this table consists of 10 rows , each of its 1st cell is link ,
    this jsfiddle.net/engchiang/ghP2a/6/ , where its output result is when i click on the 1st cell in 1st row , and the 1st row HTML will show as: tr class="shown" , the other 9 rows HTML will show as: tr class="hidden"
    this jsfiddle.net/engchiang/ghP2a/7/ , where its output result is when i click on the 2nd cell in 1st row , and the HTML of the 2nd row will show as: tr class="shown" , but the HTML of the 1st row will change to: tr class="hidden" disabled="true"
    then when i click on 1st cell in 3rd row , it show the 3rd row contents and hide the other row contents...
    Is there any method that will cause the webpage expand all its tree contents when I open the webpage, or cause the link to not hide its contents automatically when I click on the other link?
    I have a google chrome custom css file, which is put in C:\Users\User\AppData\Local\Google\Chrome\User Data\Default\User StyleSheets\
    can you provide me a code which can be put into my custom css? if you can solve my problem then i will no need to be work for my boss extra 1,2 hours everyday.
    Thank You!!
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2014
    Posts
    8
    Rep Power
    0
    somebody please help me, i need to work for my boss extra 1,2 hours everyday and cannot be claim.
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2014
    Posts
    29
    Rep Power
    0
    Hi,

    have you solved this yet?

    If not, does this work?
    • Use the 'View Source' feature of your browser
    • Copy everything into a text document (e.g. Notepad++, or even Notepad, if you must)
    • Delete everything in the <head> element except for <title>
    • open the resulting HTML file in your browser
  6. #4
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2014
    Posts
    8
    Rep Power
    0
    hi LindaJeanne , thanks for your reply,

    the below is the source before Delete everything in the <head> element except for <title>

    <head><title>
    bet365
    </title><meta name="viewport" content="initial-scale......></head>


    the below is the source after Delete everything in the <head> element except for <title>

    <head><title>
    bet365
    </title></head>

    did you mean this? And i have paste the source into jsfiddle.net
    but both of the result before and after delete are also same.
    i have save both this 2 file as html file and shared it on net, the 1st is before delete, the 2nd is after delete:

    dropbox.com/s/i9ntkp6o06pagkf/before%20delete%20head.html

    dropbox.com/s/9o9oasioyhkdjjd/after%20delete%20head.html


    this site need my boss's password, i dont have any permission, my boss log in this site and save this file as html file and shared it, here is the link:
    dropbox.com/sh/nvu5nnybywaqute/obJC4upkad

    if you could not download this file, then i paste its source to here,
    Thank you!
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2014
    Posts
    8
    Rep Power
    0
    someone have write a css code below to me before:

    TR.hidden{
    display:table-row !important;
    }

    i have put this code into my chrome custom css file, but the table row is just became bigger , still cannot show its contents , i have uploaded this 2 pictures , the 1st is before using this css , the 2nd is after using this css :
    dropbox.com/s/q3upxqnma8hmlew/001a.jpg
    dropbox.com/s/0qh4anmeczg4b3y/001b.jpg
  10. #6
  11. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2014
    Posts
    29
    Rep Power
    0
    Oh! So it's not the data that's showing. I thought you were trying to get the

    Code:
    高于 12.5 @ 2.20
    160.00 SGD  Single 	10/02/2014 01:21:37 	160.00 	0.00
    but it looks like there's more data behind that (that I can't get to, because it requires a login) that is pulled up via javascript.

    The link on each row calls a javascript
    Code:
    <a 
       class="transLink" 
       evt="" 
    onclick="javascript:BetConfirm.RenderBetSlip('6112069062#2'); return false;" 
       href="https://members.bet365.com/MEMBERS/Authenticated/History/Sports/Default.aspx#">
    There's no way to fix this just using CSS, because the information isn't on the page -- it's called up by javascript when you click the link.

    If the computer you're on is able to authenticate automatically (that is, if you don't need to type a password each time), then doing a search-and-replace on "onclick" and changing it to "onload" on the saved HTML file may give you what you need.
  12. #7
  13. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2014
    Posts
    8
    Rep Power
    0
    hi LindaJeanne, i have copy and paste the source into notepad , and replace all onlick to onload, and save as html file format. but when i click the link in each table row, it will not expand and show its contents.

    the 2 files i have shared to you also will not expand and show its contents after click its link in each table row.
    dropbox.com/s/i9ntkp6o06pagkf/before%20delete%20head.html
    dropbox.com/s/9o9oasioyhkdjjd/after%20delete%20head.html

    i then ask my boss login, and i right click>inspect elements in chrome, and edit attribute onclick to onload, then i click its link in table row, it will not expand and show its contents.

    what happen?
  14. #8
  15. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2014
    Posts
    29
    Rep Power
    0
    I guess the javascript is set up to prevent that from working.

    I think that to see all the rows at once, you'd need the help of whoever runs that website, unfortunately.

    Even if there is a way to hack with the javascript enough to get it to work, it would probably be hackerish enough to be against the terms of service.

    Wish I could offer more help =^/
  16. #9
  17. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2014
    Posts
    8
    Rep Power
    0
    hi LindaJeanne, thanks a lot, i have google search for an similar example, and this example is similar to my problem:
    http://jsfiddle.net/jaltez/LgrNF/
    is this one example can be edit to show all the contents?
  18. #10
  19. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2014
    Posts
    29
    Rep Power
    0
    The thing that complicates yours is the requirement for authorization on each click -- I don't know how to get it to recognize authorization for all the rows at once. It seems to have been designed specifically to prevent that.
  20. #11
  21. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2014
    Posts
    8
    Rep Power
    0
    hi LindaJeanne, want to ask you again, do you know excel VBA? i want to use Excel VBA to extract webpage data into excel, last time i use .document.all.tags("table").Rows.Cells.Click
    to simulate the mouse left click to click table in this website
    http://info.bet007.com/cn/League.aspx?SclassID=36

    the table contain 38 cells,
    https://www.dropbox.com/s/wjb3km45akrxm4z/table_1%20to%2038.jpg
    it will show different contents when click on each cell, the mouse left click can be simulate by .document.all.tags("table").Rows.Cells.Click

    now i meet a problem in this table,
    https://www.dropbox.com/s/4w5ol7yn6e86wdy/table_365.jpg
    this table contain 9 rows, the text in 1st cells in each rows is a hyperlink, the text "Under 16.0 @ 1.70" will show new contents when click on it,
    .document.all.tags("table").Rows.Cells.Click is unable to use in this situation, the entire cell is a hyperlink in the previous example, but this one only its text is hyperlink.

    can you help me on this? Thank you !
  22. #12
  23. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2014
    Posts
    8
    Rep Power
    0

    Smile


    hi LindaJeanne, thanks for your reply, you are so helpful, i will not forget, i have just use getElementbyid to solve this problem.

IMN logo majestic logo threadwatch logo seochat tools logo