Jump to content


Photo

Link Opening In A New Tab


  • Please log in to reply
1 reply to this topic

#1 Josh

Josh

    Advanced Member

  • UBot Users
  • PipPipPip
  • 339 posts
  • OS:Windows 7
  • Total Memory:More Than 9Gb
  • Framework:v3.5 & v4.0
  • License:Dev

Posted 06 March 2012 - 03:37 PM

So I'm writing a bot to post an article to IdeaMarketers.com. After the article posts I there is a link "click here to view your article"

When the link is clicked in a normal browser it opens in a new tab. In Ubot it opens in what appears to be a modal window. With the "close window" at the top.

I need to scrape the url from the new page that opened, but when I try it only scrapes the url from the parent page.

Does anyone know how to go about scraping the url from the new window that opens up?

#2 Josh

Josh

    Advanced Member

  • UBot Users
  • PipPipPip
  • 339 posts
  • OS:Windows 7
  • Total Memory:More Than 9Gb
  • Framework:v3.5 & v4.0
  • License:Dev

Posted 06 March 2012 - 04:50 PM

So I figured this out all by my little self. I figured I'd share this for anyone else who has to go through this headache.

So like I said above there is a "click here" link on the page that opens in a popup type window that shows where my article is located. And if I click that link there isn't a way for me to scrape the url from the popup window page. So here is my work around...

1. On the page that contains the "click here" link I used an add to list node and used the page scrape parameter. I selected the text before the "click here" link and the text after the link.

2. This added the link as html to my list. I then used "save to file" to save my list.

3. Then I used "clear list"

4. Next I used "add item to list" with the replace parameter. In the original text field I used the "read file" parameter and selected my saved file. In the search field I pasted the beginning part of the html I wanted to get rid of, and I left the replace text field blank.

5. Then I used the "delete file" node to deleted the file that I created.

6. I used the "save to file" node to re-save my list.

7. Then I cleared the list again.

8. Next I used "add item to list" with the replace parameter. I added the read file parameter in the original text field and the second half of the html code in the search text field. I left the replace field blank.

9. I deleted the file

10. I saved the list to file.

That's it. Kind of a lot of stuff to just get a url. Would be much nicer if Ubot supported tabbed windows.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users