bhaktanishant's Profile User Rating: -----

Reputation: 0 Apprentice
Group:
Members
Active Posts:
18 (0.03 per day)
Joined:
19-November 12
Profile Views:
1,588
Last Active:
User is offline Nov 01 2013 03:24 AM
Currently:
Offline

Previous Fields

Dream Kudos:
0
Icon   bhaktanishant has not set their status

Posts I've Made

  1. In Topic: how to extract page-URL using BeautifulSoup

    Posted 31 Oct 2013

    View Postwiteboy724, on 31 October 2013 - 12:51 PM, said:

    I'm not sure what you're asking. You specify the URL in your code in your 3rd line. This is what BS loads. So you already have that..

    Maybe you want the rest of the links on the page using something like this:
    from bs4 import BeautifulSoup
    import requests
    
    url = 'dreamincode.net'
    
    r  = requests.get("http://" +url)
    
    data = r.text
    
    soup = BeautifulSoup(data)
    
    for link in soup.find_all('a'):
        print(link.get('href'))
    
    


    But you definitely need the page's URL before you can send that to BS, so it's not really something that needs to be read back from BS afterwards. I have experience with BeautifulSoup, so if you clarify what you need then I may be able to help


    Thanks for your response. You didn't understand my question, i was asking that if u don't know the link (in this case: www.dreamincode.net) that have been souped, then how will you get the link from souped object.
    Anyway i get my problem solved.
    THANKS
  2. In Topic: confusion in recursion

    Posted 13 Dec 2012

    Thank you adak and CY5 now i get recursion.

    adak your method to put 'printf' before break; to see how break; works is very good. it help me to understand how is function working.

    CY5 by applying 'printf' before break; it was clear that how is break; working but was not clear that how the output 2,2,3 was printed without break;. but you elaborate it to me that how code printing output without break;.

    THANKS...
  3. In Topic: wrong output to find prime factor of number

    Posted 12 Dec 2012

    {
                       printf("\n%d",i);
                       v=v/i;
                       i=1;
              }
     
    

    by change i=1; get true result.
  4. In Topic: wrong output to find prime factor of number

    Posted 12 Dec 2012

    View Postraghav.naganathan, on 12 December 2012 - 09:06 PM, said:

    You can use a while loop instead if you just want to keep i as it is.

    while(i<=v)
    {
        if (v%i==0)
             {
    	  printf("\n%d",i);
    	  v=v/i;
              }
    i++;
    }
    



    regards,
    Raghav


    By your code 'i'will continuously increase by 1. but i want to reset 'i' to 2.

    because for every v=v/i;, i should must start division from 2.
  5. In Topic: wrong output to find prime factor of number

    Posted 12 Dec 2012

    I think 'i' is not resetting at 2 in 'if' command but why?

My Information

Member Title:
New D.I.C Head
Age:
Age Unknown
Birthday:
Birthday Unknown
Gender:

Contact Information

E-mail:
Private

Comments

bhaktanishant has no profile comments yet. Why not say hello?