We study the optimal pricing strategy for profit maximization in presence of network externalities where a decision to buy a product depends on the price offered to the buyer and also on the set of her friends who have already bought that product. We model the network influences by a weighted graph where the utility of each buyer is the sum of her initial value on the product, and the linearly additive influence from her friends. We assume that the buyers arrive online and the seller should offer a price to each buyer when she enters the market. We also take into account the manufacturing cost. In this paper, we first assume that the monopolist defines a unique price for the product and commits to it for all buyers. In this case, we present an FPTAS algorithm that approximates the optimal price with a high probability. We also prove that finding the optimum price is NP-hard. Second, we consider a market with positive network externalities and assume that the monopolist could offer a private price to each customer. We prove that this problem is also hard to approximate for linear influences. On the positive side, we present a polynomial time algorithm for the problem when influences are symmetric. At last, we show that the seller has more ability to extract influences with price discrimination.