Jump to content
UBot Underground

a-harvey

Members
  • Content Count

    53
  • Joined

  • Last visited

Posts posted by a-harvey

  1. Hi,

    I am trying to scrape some individual items from this page.

    https://www.silverstoneauctions.com/index.php?option=com_bidding&view=commission&layout=details&id=12678

    I have got a few items working fine, but when I try and scrape the item at the bottom, Chassis Number, it pulls in all the date, lot number, MOT etc all from this one selection.

    I need all of them but as individual items on the same table row, so ideally scraping Lot Number, Chassis Number, MOT etc.. I don't seem to be able to get it to work with this webpage.

    The Same with the top bullets in the description, I can scrape the whole description but not the bullets on their own.. ahhhhh

     

    Any help work be great or the function I need to look at.

     

    Many thanks

    Andrew

     

    clear list(%Title)
    clear list(%Strap)
    clear list(%image)
    clear list(%Lot Number)
    clear list(%Chassis Number)
    navigate("https://www.silverstoneauctions.com/index.php?option=com_bidding&view=commission&layout=details&id=12678","Wait")
    clear table(&silvesrtonenew)
    add list to list(%Title,$scrape attribute(<class="mb-3 text-blue">,"innertext"),"Don\'t Delete","Local")
    add list to list(%image,$scrape attribute(<src="https://www.silverstoneauctions.com/assets/lot_images/xlarge/rec10236-1_1.jpg">,"src"),"Don\'t Delete","Local")
    add item to list(%Strap,$scrape attribute(<id="summary">,"innertext"),"Don\'t Delete","Local")
    add list to list(%Chassis Number,$scrape attribute(<class="col-7 col-xl-9">,"innertext"),"Don\'t Delete","Local")
    add list to table as column(&silvesrtonenew,0,0,%Title)
    add list to table as column(&silvesrtonenew,0,1,%Strap)
    add list to table as column(&silvesrtonenew,0,2,%image)
    save to file("C:\\Users\\Andrew\\Desktop\\silvertest.csv",&silvesrtonenew)

  2. Hi,

     

    I have been using a script for a while to download images from urls and name then when they are downloaded.

    script is attached, for some reason it just will not work with the clients new site:

     

    I am getting:

    Error: The request was aborted: could not create SSL/TLS secure channel.

    Source "file name >loop>download file.

     

    Is there anything I can do my end ?

     

    Many thanks

    Andrew

     

    the csv silverim.csv just has a name be that 20 in first cell and url in next

     

     

    clear table(&images)
    create table from file("C:\\Users\\Andrew\\Desktop\\silverim.csv",&images)
    set(#row,0,"Global")
    create folder($special folder("Desktop"),"SilverstoneImages")
    set(#path,"{$special folder("Desktop")}/SilverstoneImages/","Global")
    loop($table total rows(&images)) {
        download file($table cell(&images,#row,1),"{#path}{$table cell(&images,#row,0)}.jpg")
        increment(#row)
    }
    shell("perl c:\\windows\\exiftool.pl -P -r \"-title<$\{filename;s/\\.[^\\.]+$//;s/[-]/ /g;s/_/ /\}\" -r -sep \" \" -ext jpg C:\\Users\\Andrew\\Desktop\\SilverstoneImages")
    shell("perl c:\\windows\\exiftool.pl -artist=\"Silverstone Auctions\" -copyright=\"2019 Silverstone Auctions\" C:\\Users\\Andrew\\Desktop\\SilverstoneImages")
    shell("perl c:\\windows\\exiftool.pl -subject=\"Silverstone Auctions RACE RETRO SALE 23rd February 2019\" C:\\Users\\Andrew\\Desktop\\SilverstoneImages")
    shell("perl c:\\windows\\exiftool.pl -creator=\"Silverstone Auctions\" C:\\Users\\Andrew\\Desktop\\SilverstoneImages")
    shell("perl c:\\windows\\exiftool.pl -P -r \"-description<$\{filename;s/\\.[^\\.]+$//;s/[-]/ /g;s/_/ /\}\" -r -sep \" \" -ext jpg C:\\Users\\Andrew\\Desktop\\SilverstoneImages")
    shell("perl c:\\windows\\exiftool.pl -P -r \"-IFD0:XPSubject<$\{filename;s/\\.[^\\.]+$//;s/[-]/ /g;s/_/ /\}\" -r -sep \" \" -ext jpg C:\\Users\\Andrew\\Desktop\\SilverstoneImages")
    shell("perl c:\\windows\\exiftool.pl -P -r \"-IFD0:XPComment<$\{filename;s/\\.[^\\.]+$//;s/[-]/ /g;s/_/ /\}\" -r -sep \" \" -ext jpg C:\\Users\\Andrew\\Desktop\\SilverstoneImages")
     

     

     

  3. Hi Pash,

    Ok so as I thought one is going to have to scrape the html star-red/star-grey from each section and then test for the red stars to generate a value that can then equate to creation of the stars in indesign be that single or as a single image of 5 stars.

     

    Thank you, that clears things up or confirms my initial thoughts so now have a decisive plan as to what needs to happen.

     

    Andrew

  4. Hi,

     

    Can someone give me a clue how best one would try and scrape the star ratings from this page:

    https://www.classiccarauctions.co.uk/porsche-928-s4-10946

     

    I need to grab all the data into a csv and then generate a print catalogue from it.

     

    The only way I am seeing to do this (the stars are the issue) is to scrape the html as "star red, star grey" and work out some search and replace in the csv which then will convert it to 4 red 1 grey etc.

     

    Any other thoughts on how to get the stars out, is there another way ? am I missing something?

     

    Many thanks

    Andrew

  5. Ok so I have finally got my head around the exif tool and the commands that I use to do what I need are below and do exactly what I am after on a folder of files, ie will be the download images from the above bot.

     

    What would the command be to enable ubot to action the commands below from within UBot so I don't have to apply them outside Ubot.

     

    So not to confuse, the current Ubot, just downloads and names the files based on a csv, I want to after it has finished downloading all the images at that stage run these commends

     

    Many thanks Andrew:

     

    perl c:\windows\exiftool.pl -P -r "-title<${filename;s/\.[^\.]+$ //;s/[-]/ /g;s/_/ /}"" -r -sep " " -ext jpg C:\Users\Andrew\Desktop\testimage
    perl c:\windows\exiftool.pl -artist="Silverstone Auctions" -copyright="2019 Silverstone Auctions" C:\Users\Andrew\Desktop\testimage
    perl c:\windows\exiftool.pl -subject="Silverstone Auctions AUTOSPORT INTERNATIONAL SHOW SALE 12th January 2019" C:\Users\Andrew\Desktop\testimage
    perl c:\windows\exiftool.pl -creator="Silverstone Auctions" C:\Users\Andrew\Desktop\testimage
    perl c:\windows\exiftool.pl -P -r "-description<${filename;s/\.[^\.]+$ //;s/[-]/ /g;s/_/ /}"" -r -sep " " -ext jpg C:\Users\Andrew\Desktop\testimage
    perl c:\windows\exiftool.pl -P -r "-IFD0:XPSubject<${filename;s/\.[^\.]+$ //;s/[-]/ /g;s/_/ /}"" -r -sep " " -ext jpg C:\Users\Andrew\Desktop\testimage
    perl c:\windows\exiftool.pl -P -r "-IFD0:XPComment<${filename;s/\.[^\.]+$ //;s/[-]/ /g;s/_/ /}"" -r -sep " " -ext jpg C:\Users\Andrew\Desktop\testimage

     

  6. Many thanks

     

    Naming and downloading is correct yes "that side is working perfect"

     

    I have looked at that tool about 3 years ago, thank you for reminding me of it.

    I can get it to do everything but it is just clearing all existing the metadata and not writing anything to it.

    hmhmhmhm

     

    path seems correct as it is now finding and wiping the data but won't write the comment will look into the tool again and see if I can figure out why its not now writing the updated info.

  7. Yes the path of where the image will be, as I will be downloading them one by one,

    so the path is set by the table in the code also the name is being set as its the same name as what I am naming the image.

     

    Hope that follows :

     

    Currently the code takes the url in coll 1 / downloads it to folder "Silverstone Images" on the desktop and gives it the name specified in coll 0

    I need to work out the required code to tell it that "this images just downloaded from the specifications given is located here. and apply the same name from the table to the meta data comment.

     

    I am going through the table one image at a time and downloading and naming, maybe its not possible to add the meta data as it downloads each image, maybe I have to download them all then create a new table with the image location and name and cycle through them adding the meta comment.

    That maybe a simpler way to do it, as I know what they will be called and where they will be, so maybe I just create another csv with that data and pull that into a new table after it has finshed downloading them all and then get it to apply the meta comment.

     

     

     

    clear table(&images)
    create table from file("C:\\Users\\Andrew\\Desktop\\silverim.csv",&images)
    set(#row,0,"Global")
    create folder($special folder("Desktop"),"Silverstone Images")
    set(#path,"{$special folder("Desktop")}/Silverstone Images/","Global")
    loop($table total rows(&images)) {
        download file($table cell(&images,#row,1),"{#path}{$table cell(&images,#row,0)}.jpg")
        increment(#row)
    }

  8. Nick,

     

    There are thousands of images pulled at any one time.

    FIO they are all named 0.jpg or 1.jpg so they need to be pulled and named Lot_x"title".jpg and cycle through them all, that is working fine with the above, I just wanted to then quickly if possible at the same time write to the metadata the same naming I am doing to the image.

     

    Hope that is more clear.

    many thanks

    Andrew

  9. Hi Nick,

     

    So my current code is below, I presume I could just add a command into the download file section that also adds the alt tag from row,0

    or would I still need to set the command Alt ?

     

    many thanks Andrew

     

    clear table(&images)
    create table from file("C:\\Users\\Andrew\\Desktop\\silverim.csv",&images)
    set(#row,0,"Global")
    create folder($special folder("Desktop"),"Silverstone Images")
    set(#path,"{$special folder("Desktop")}/Silverstone Images/","Global")
    loop($table total rows(&images)) {
        download file($table cell(&images,#row,1),"{#path}{$table cell(&images,#row,0)}.jpg")
        increment(#row)
    }

×
×
  • Create New...